From: Jonathan Hudson Date: Thu, 1 May 1997 02:20:23 +0000 (+1200) Subject: VMS update, including socket support (four patches) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d27fe803587dd19cb1812b267492c364c09580fa;p=p5sagit%2Fp5-mst-13.2.git VMS update, including socket support (four patches) Signed-off-by: Peter Prymmer Signed-off-by: Dan Sugalski --- diff --git a/vms/config.vms b/vms/config.vms index 1d6d131..cba3361 100644 --- a/vms/config.vms +++ b/vms/config.vms @@ -8,7 +8,7 @@ * GenConfig.pl when producing Config.pm. * * config.h for VMS - * Version: 5.003_08 + * Version: 5.004 */ /* Configuration time: 19-Nov-1996 23:34 @@ -76,7 +76,7 @@ * when Perl is built. Please do not change it by hand; make * any changes to FndVers.Com instead. */ -#define ARCHLIB_EXP "/perl_root/lib/VMS_VAX/5_00399" /**/ +#define ARCHLIB_EXP "/perl_root/lib/VMS_VAX/5_004" /**/ #define ARCHLIB ARCHLIB_EXP /*config-skip*/ /* ARCHNAME: @@ -962,7 +962,11 @@ * is defined, and 'int *' otherwise. This is only useful if you * have select(), of course. */ -#define Select_fd_set_t int * /**/ +#if defined(__DECC) && defined(__DECC_VER) && (__DECC_VER >= 50200000) +#define Select_fd_set_t fd_set * /* config-skip */ +#else +#define Select_fd_set_t int * /**/ +#endif /* STDCHAR: * This symbol is defined to be the type of char used in stdio.h. diff --git a/vms/descrip.mms b/vms/descrip.mms index 29ee690..15a297b 100644 --- a/vms/descrip.mms +++ b/vms/descrip.mms @@ -65,7 +65,7 @@ OBJVAL = $(MMS$TARGET_NAME)$(O) .endif # Updated by fndvers.com -- do not edit by hand -PERL_VERSION = 5_00399# +PERL_VERSION = 5_004 # ARCHDIR = [.lib.$(ARCH).$(PERL_VERSION)] diff --git a/vms/sockadapt.h b/vms/sockadapt.h index d7f7cdc..f24faea 100644 --- a/vms/sockadapt.h +++ b/vms/sockadapt.h @@ -32,6 +32,9 @@ void endprotoent(void); void setservent(int); void endservent(void); +# if defined(__DECC) && defined(__DECC_VER) && (__DECC_VER >= 50200000) +# define Sock_size_t unsigned int +# endif #else /* Pull in SOCKETSHR's header, and set up structures for diff --git a/vms/vms.c b/vms/vms.c index 2fd6fc5..6ff1110 100644 --- a/vms/vms.c +++ b/vms/vms.c @@ -2880,6 +2880,22 @@ my_fwrite(void *src, size_t itmsz, size_t nitm, FILE *dest) } /* end of my_fwrite() */ /*}}}*/ +/*{{{ int my_flush(FILE *fp)*/ +int +my_flush(FILE *fp) +{ + int res; + if ((res = fflush(fp)) == 0) { +#ifdef VMS_DO_SOCKETS + struct mystat s; + if (Fstat(fileno(fp), &s) == 0 && !S_ISSOCK(s.st_mode)) +#endif + res = fsync(fileno(fp)); + } + return res; +} +/*}}}*/ + /* * Here are replacements for the following Unix routines in the VMS environment: * getpwuid Get information for a particular UIC or UID diff --git a/vms/vmsish.h b/vms/vmsish.h index 9917232..841b119 100644 --- a/vms/vmsish.h +++ b/vms/vmsish.h @@ -125,6 +125,7 @@ # define do_aspawn Perl_do_aspawn # define do_spawn Perl_do_spawn # define my_fwrite Perl_my_fwrite +# define my_flush Perl_my_flush # define my_binmode Perl_my_binmode # define my_getpwnam Perl_my_getpwnam # define my_getpwuid Perl_my_getpwuid @@ -284,6 +285,9 @@ */ #define fwrite1 my_fwrite +/* By default, flush data all the way to disk, not just to RMS buffers */ +#define Fflush(fp) my_flush(fp) + /* Use our own rmdir() */ #define rmdir(name) do_rmdir(name) @@ -357,9 +361,6 @@ struct utimbuf { #define Stat(name,bufptr) flex_stat(name,bufptr) #define Fstat(fd,bufptr) flex_fstat(fd,bufptr) -/* By default, flush data all the way to disk, not just to RMS buffers */ -#define Fflush(fp) ((fflush(fp) || fsync(fileno(fp))) ? EOF : 0) - /* Setup for the dirent routines: * opendir(), closedir(), readdir(), seekdir(), telldir(), and * vmsreaddirversions(), and preprocessor stuff on which these depend: @@ -546,6 +547,7 @@ bool vms_do_exec _((char *)); unsigned long int do_aspawn _((SV *, SV **, SV **)); unsigned long int do_spawn _((char *)); int my_fwrite _((void *, size_t, size_t, FILE *)); +int my_flush _((FILE *)); FILE * my_binmode _((FILE *, char)); struct passwd * my_getpwnam _((char *name)); struct passwd * my_getpwuid _((Uid_t uid));