X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/eb1102fcca2230364ceadea29bd8e87ee51b15fa..369d8e4931dc02d2a39ae1202c0b0f5a5dd2aeea:/vos/vos.c diff --git a/vos/vos.c b/vos/vos.c index c3566d4..9876d70 100644 --- a/vos/vos.c +++ b/vos/vos.c @@ -1,14 +1,19 @@ /* Beginning of modification history */ /* Written 02-01-02 by Nick Ing-Simmons (nick@ing-simmons.net) */ +/* Modified 02-03-27 by Paul Green (Paul.Green@stratus.com) to + add socketpair() dummy. */ +/* Modified 02-04-24 by Paul Green (Paul.Green@stratus.com) to + have pow(0,0) return 1, avoiding c-1471. */ /* End of modification history */ -/* VOS doesn't supply a truncate function, so we build one up - from the available POSIX functions. */ - +#include #include #include #include +/* VOS doesn't supply a truncate function, so we build one up + from the available POSIX functions. */ + int truncate(const char *path, off_t len) { @@ -20,3 +25,34 @@ truncate(const char *path, off_t len) } return code; } + +/* VOS doesn't implement AF_UNIX (AF_LOCAL) style sockets, and + the perl emulation of them hangs on VOS (due to stcp-1257), + so we supply this version that always fails. */ + +int +socketpair (int family, int type, int protocol, int fd[2]) { + fd[0] = 0; + fd[1] = 0; + errno = ENOSYS; + return -1; +} + +/* Supply a private version of the power function that returns 1 + for x**0. This avoids c-1471. Abigail's Japh tests depend + on this fix. We leave all the other cases to the VOS C + runtime. */ + +double s_crt_pow(double *x, double *y); + +double pow(x,y) +double x, y; +{ + if (y == 0e0) /* c-1471 */ + { + errno = EDOM; + return (1e0); + } + + return(s_crt_pow(&x,&y)); +}