[Info-vax] Open Source on OpenVMS - need some feedback

Craig A. Berry craigberry at nospam.mac.com
Fri Jan 2 18:45:23 EST 2015


On 1/2/15 9:18 AM, John Reagan wrote:
> I'm just trying to collect input on things that could be
> better/faster/newer.

1.) A better pipe() implementation would be at the top of my list. I
think David Jones has a very promising solution to the various
challenges with his dmpipe:

<http://sourceforge.net/p/vms-ports/dmpipe/ci/default/tree/>

but it or something very much like it really needs to be integrated into
the CRTL rather than via wrappers.

2.) To make a socket non-blocking on VMS (or, as it turns out, Windows)
you have to call ioctl with FIONBIO rather than calling fcntl with
O_NONBLOCK. The workaround works, but it requires special-case code and
violates the standard, so it would be better to fix fcntl.

3.) A more minor thing I stumbled on recently is that the floating point
classification routines are a bit behind. We don't have fpclassify
(pretty similar to the older fp_classify) and some of the things we do
have are in fp.h rather than math.h as the standard requires. There was
a typo in the isnormal macro but I think that was fixed in the latest
CRTL ECO. The macros also tend not to work with long doubles, as the
following example with isfinite illustrates:

$ type check_isfinite.c
#include <float.h>
#include <fp.h>
#include <stdio.h>
#include <stdlib.h>

int main() {
     double x;
     long double y;

     x = DBL_INFINITY;
     if (isfinite(x))
         printf("Oops! -- INFINITY double is finite\n");
     else
         printf("INFINITY double is NOT finite\n");

     x = 1.0;
     if (isfinite(x))
         printf("1.0 double is finite\n");
     else
         printf("Oops! -- 1.0 double is NOT finite\n");

     y = LDBL_INFINITY;
     if (isfinite(y))
         printf("Oops! -- INFINITY long double is finite\n");
     else
         printf("INFINITY long double is NOT finite\n");

     y = 1.0;
     if (isfinite(y))
         printf("1.0 long double is finite\n");
     else
         printf("Oops! -- 1.0 long double is NOT finite\n");
}
$ cc/floate=IEEE/IEEE=denorm check_isfinite
$ link check_isfinite
$ r check_isfinite
INFINITY double is NOT finite
1.0 double is finite
Oops! -- INFINITY long double is finite
1.0 long double is finite



More information about the Info-vax mailing list