diff options
author | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1997-10-08 10:19:27 +0000 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1997-10-08 10:19:27 +0000 |
commit | 93af7a870f71dbbb13443b4087703de0221add17 (patch) | |
tree | e767c53d4d4f1783640e5410f94655e45b58b3d0 /vms | |
parent | c116a00cf797ec2e6795338ee18b88d975e760c5 (diff) | |
parent | 2269e8ecc334a5a77bdb915666547431c0171402 (diff) | |
download | perl-93af7a870f71dbbb13443b4087703de0221add17.tar.gz |
Merge maint-5.004 branch (5.004_03) with mainline.
MANIFEST is out of sync.
p4raw-id: //depot/perl@114
Diffstat (limited to 'vms')
-rw-r--r-- | vms/config.vms | 85 | ||||
-rw-r--r-- | vms/descrip.mms | 41 | ||||
-rw-r--r-- | vms/ext/filespec.t | 32 | ||||
-rw-r--r-- | vms/sockadapt.c | 8 | ||||
-rw-r--r-- | vms/sockadapt.h | 3 | ||||
-rw-r--r-- | vms/test.com | 7 | ||||
-rw-r--r-- | vms/vms.c | 34 | ||||
-rw-r--r-- | vms/vmsish.h | 10 |
8 files changed, 185 insertions, 35 deletions
diff --git a/vms/config.vms b/vms/config.vms index cba33616d7..d6453ba34a 100644 --- a/vms/config.vms +++ b/vms/config.vms @@ -112,7 +112,11 @@ * This symbol is defined if the bcmp() routine is available to * compare blocks of memory. */ -#undef HAS_BCMP /**/ +#if ((__VMS_VER >= 70000000) && (__DECC_VER >= 50200000)) || (__CRTL_VER >= 70000000) +#define HAS_BCMP /**/ +#else +#undef HAS_BCMP /*config-skip*/ +#endif #include <string.h> /* Check whether new DECC has #defined bcopy and bzero */ /* HAS_BCOPY: @@ -233,7 +237,11 @@ * <sys/resource.h> needs to be included (see I_SYS_RESOURCE). * The type "Timeval" should be used to refer to "struct timeval". */ -#undef HAS_GETTIMEOFDAY /**/ +#if ((__VMS_VER >= 70000000) && (__DECC_VER >= 50200000)) || (__CRTL_VER >= 70000000) +#define HAS_GETTIMEOFDAY /**/ +#else +#undef HAS_GETTIMEOFDAY /*config-skip*/ +#endif #ifdef HAS_GETTIMEOFDAY # define Timeval struct timeval /*config-skip*/ #endif @@ -256,7 +264,11 @@ * uname() routine to derive the host name. See also HAS_GETHOSTNAME * and PHOSTNAME. */ -#undef HAS_UNAME /**/ +#if ((__VMS_VER >= 70000000) && (__DECC_VER >= 50200000)) || (__CRTL_VER >= 70000000) +#define HAS_UNAME /**/ +#else +#undef HAS_UNAME /*config-skip*/ +#endif /* HAS_GETPRIORITY: * This symbol, if defined, indicates that the getpriority routine is @@ -492,7 +504,11 @@ * This symbol, if defined, indicates that Vr4's sigaction() routine * is available. */ -#undef HAS_SIGACTION /**/ +#if ((__VMS_VER >= 70000000) && (__DECC_VER >= 50200000)) || (__CRTL_VER >= 70000000) +#define HAS_SIGACTION /**/ +#else +#undef HAS_SIGACTION /*config-skip*/ +#endif /* USE_STAT_BLOCKS: * This symbol is defined if this system has a stat structure declaring @@ -622,7 +638,11 @@ * This symbol, if defined, indicates that the truncate routine is * available to truncate files. */ -#undef HAS_TRUNCATE /**/ +#if ((__VMS_VER >= 70000000) && (__DECC_VER >= 50200000)) || (__CRTL_VER >= 70000000) +#define HAS_TRUNCATE /**/ +#else +#undef HAS_TRUNCATE /*config-skip*/ +#endif /* HAS_VFORK: @@ -664,7 +684,11 @@ /* HAS_WAIT4: * This symbol, if defined, indicates that wait4() exists. */ -#undef HAS_WAIT4 /**/ +#if ((__VMS_VER >= 70000000) && (__DECC_VER >= 50200000)) || (__CRTL_VER >= 70000000) +#define HAS_WAIT4 /**/ +#else +#undef HAS_WAIT4 /*config-skip*/ +#endif /* HAS_WAITPID: * This symbol, if defined, indicates that the waitpid routine is @@ -962,10 +986,10 @@ * is defined, and 'int *' otherwise. This is only useful if you * have select(), of course. */ -#if defined(__DECC) && defined(__DECC_VER) && (__DECC_VER >= 50200000) -#define Select_fd_set_t fd_set * /* config-skip */ +#if defined(__DECC) && defined(__DECC_VER) && (__DECC_VER >= 50200000) && defined(DECCRTL_SOCKETS) +#define Select_fd_set_t fd_set * /**/ #else -#define Select_fd_set_t int * /**/ +#define Select_fd_set_t int * /* config-skip */ #endif /* STDCHAR: @@ -1161,7 +1185,11 @@ * functions are available for string searching. */ #define HAS_STRCHR /**/ -#undef HAS_INDEX /**/ +#if ((__VMS_VER >= 70000000) && (__DECC_VER >= 50200000)) || (__CRTL_VER >= 70000000) +#define HAS_INDEX /**/ +#else +#undef HAS_INDEX /*config-skip*/ +#endif /* HAS_STRCOLL: * This symbol, if defined, indicates that the strcoll routine is @@ -1347,9 +1375,17 @@ * corresponds to the 0 at the end of the sig_num list. * See SIG_NUM and SIG_MAX. */ +#if ((__VMS_VER >= 70000000) && (__DECC_VER >= 50200000)) || (__CRTL_VER >= 70000000) +#define SIG_NAME "ZERO","HUP","INT","QUIT","ILL","TRAP","IOT","EMT","FPE",\ + "KILL","BUS","SEGV","SYS","PIPE","ALRM","TERM",\ + "ABRT","USR1","USR2","SPARE18","SPARE19","CHLD","CONT",\ + "STOP","TSTP","TTIN","TTOU","DEBUG","SPARE27","SPARE28",\ + "SPARE29","SPARE30","SPARE31","SPARE32","RTMIN","RTMAX",0 /**/ +#else #define SIG_NAME "ZERO","HUP","INT","QUIT","ILL","TRAP","IOT","EMT","FPE",\ "KILL","BUS","SEGV","SYS","PIPE","ALRM","TERM",\ - "ABRT","USR1","USR2",0 + "ABRT","USR1","USR2",0 /*config-skip*/ +#endif /* SIG_NUM: * This symbol contains a list of signal number, in the same order as the @@ -1364,7 +1400,11 @@ * The last element is 0, corresponding to the 0 at the end of * the sig_name list. */ -#define SIG_NUM 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,6,16,17,0 /**/ +#if ((__VMS_VER >= 70000000) && (__DECC_VER >= 50200000)) || (__CRTL_VER >= 70000000) +#define SIG_NUM 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,6,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,64,0 /**/ +#else +#define SIG_NUM 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,6,16,17,0 /*config-skip*/ +#endif /* Mode_t: * This symbol holds the type used to declare file modes @@ -1598,8 +1638,13 @@ * to determine file-system related limits and options associated * with a given open file descriptor. */ -#undef HAS_PATHCONF /**/ -#undef HAS_FPATHCONF /**/ +#if ((__VMS_VER >= 70000000) && (__DECC_VER >= 50200000)) || (__CRTL_VER >= 70000000) +#define HAS_PATHCONF /**/ +#define HAS_FPATHCONF /**/ +#else +#undef HAS_PATHCONF /*config-skip*/ +#undef HAS_FPATHCONF /*config-skip*/ +#endif /* HAS_SAFE_BCOPY: * This symbol, if defined, indicates that the bcopy routine is available @@ -1658,7 +1703,11 @@ * This symbol, if defined, indicates that sysconf() is available * to determine system related limits and options. */ -#undef HAS_SYSCONF /**/ +#if ((__VMS_VER >= 70000000) && (__DECC_VER >= 50200000)) || (__CRTL_VER >= 70000000) +#define HAS_SYSCONF /**/ +#else +#undef HAS_SYSCONF /*config-skip*/ +#endif /* Gconvert: * This preprocessor macro is defined to convert a floating point @@ -1718,7 +1767,11 @@ * This macro is used in the same way as siglongjmp(), but will invoke * traditional longjmp() if siglongjmp isn't available. */ -#undef HAS_SIGSETJMP /**/ +#if ((__VMS_VER >= 70000000) && (__DECC_VER >= 50200000)) || (__CRTL_VER >= 70000000) +#define HAS_SIGSETJMP /**/ +#else +#undef HAS_SIGSETJMP /*config-skip*/ +#endif #ifdef HAS_SIGSETJMP #define Sigjmp_buf sigjmp_buf /* config-skip */ #define Sigsetjmp(buf,save_mask) sigsetjmp(buf,save_mask) /* config-skip */ diff --git a/vms/descrip.mms b/vms/descrip.mms index 15a297b838..7681f21586 100644 --- a/vms/descrip.mms +++ b/vms/descrip.mms @@ -24,7 +24,10 @@ #: To each of the above, add /Macro="__AXP__=1" if building on an AXP, #: /Macro="__DEBUG__=1" to build a debug version #: (i.e. VMS debugger, not perl -D), and -#: /Macro="SOCKET=1" to include socket support. +#: /Macro="SOCKETSHR_SOCKETS=1" to include +#: SOCKETSHR socket support. +#: /Macro="DECC_SOCKETS=1" to include UCX (or +#: compatible) socket support # # tidy -- purge files generated by executing this file # clean -- remove all intermediate (e.g. object files, C files generated @@ -67,6 +70,25 @@ OBJVAL = $(MMS$TARGET_NAME)$(O) # Updated by fndvers.com -- do not edit by hand PERL_VERSION = 5_004 # +.ifdef DECC_SOCKETS +SOCKET=1 +.endif + +.ifdef SOCKETSHR_SOCKETS +SOCKET=1 +.endif + +# If they defined SOCKET but didn't choose a stack, default to SOCKETSHR +.ifdef DECC_SOCKETS +.else +.ifdef SOCKETSHR_SOCKETS +.else +.ifdef SOCKET +SOCKETSHR_SOCKETS=1 +.endif +.endif +.endif + ARCHDIR = [.lib.$(ARCH).$(PERL_VERSION)] ARCHCORE = [.lib.$(ARCH).$(PERL_VERSION).CORE] @@ -78,6 +100,9 @@ ARCHAUTO = [.lib.$(ARCH).$(PERL_VERSION).auto] PIPES_BROKEN = 1 .endif +.ifdef __DEBUG__ +NOX2P = 1 +.endif #: >>>>>Compiler-specific options <<<<< .ifdef GNUC @@ -142,7 +167,7 @@ DBGLINKFLAGS = /Trace/Debug/Map/Full/Cross DBG = DBG .else DBGCCFLAGS = /NoList -DBGLINKFLAGS = /NoMap +DBGLINKFLAGS = /NoTrace/NoMap DBG = .endif @@ -150,8 +175,13 @@ DBG = #: By default, used SOCKETSHR library; see ReadMe.VMS #: for information on changing socket support .ifdef SOCKET +.ifdef DECC_SOCKETS +SOCKDEF = ,VMS_DO_SOCKETS,DECCRTL_SOCKETS +SOCKLIB = +.else SOCKDEF = ,VMS_DO_SOCKETS SOCKLIB = SocketShr/Share +.endif # N.B. the targets for $(SOCKC) and $(SOCKH) assume that the permanent # copies live in [.vms], and the `clean' target will delete copies of # these files in the current default directory. @@ -272,8 +302,13 @@ LIBPREREQ = $(ARCHDIR)Config.pm [.lib]DynaLoader.pm [.lib]vmsish.pm [.lib.VMS]Fi utils1 = [.lib.pod]perldoc.com [.lib.ExtUtils]Miniperl.pm [.utils]c2ph.com [.utils]h2ph.com [.utils]h2xs.com [.lib]perlbug.com utils2 = [.lib]splain.com [.utils]pl2pm.com +.ifdef NOX2P +all : base extras archcorefiles preplibrary perlpods + @ $(NOOP) +.else all : base extras x2p archcorefiles preplibrary perlpods @ $(NOOP) +.endif base : miniperl perl @ $(NOOP) extras : Fcntl IO Opcode $(POSIX) libmods utils podxform @@ -330,7 +365,7 @@ $(DBG)perl$(E) : perlmain$(O), $(DBG)perlshr$(E), $(MINIPERL_EXE) .endif $(DBG)perlshr$(E) : $(DBG)libperl$(OLB) $(extobj) $(DBG)perlshr_xtras.ts - Link /NoTrace$(LINKFLAGS)/Share=$(MMS$TARGET) $(extobj) []$(DBG)perlshr_bld.opt/Option, perlshr_attr.opt/Option + Link $(LINKFLAGS)/Share=$(MMS$TARGET) $(extobj) []$(DBG)perlshr_bld.opt/Option, perlshr_attr.opt/Option # The following files are built in one go by gen_shrfls.pl: # perlshr_attr.opt, $(DBG)perlshr_bld.opt - VAX and AXP diff --git a/vms/ext/filespec.t b/vms/ext/filespec.t index 62b06fe9ed..6201a42dc6 100644 --- a/vms/ext/filespec.t +++ b/vms/ext/filespec.t @@ -25,11 +25,33 @@ foreach $test (@tests) { } } -print +(rmsexpand('[]') eq "\U$ENV{DEFAULT}" ? 'ok ' : 'not ok '),++$idx,"\n"; -print +(rmsexpand('from.here') eq "\L$ENV{DEFAULT}from.here" ? - 'ok ' : 'not ok '),++$idx,"\n"; -print +(rmsexpand('from.here','cant:[get.there];2') eq - 'cant:[get.there]from.here;2' ? 'ok ' : 'not ok '),++$idx,"\n"; +if (rmsexpand('[]') eq "\U$ENV{DEFAULT}") { print 'ok ',++$idx,"\n"; } +else { + print 'not ok ', ++$idx, ": rmsexpand('[]') = |", rmsexpand('[]'), + "|, \$ENV{DEFAULT} = |\U$ENV{DEFAULT}|\n"; + print "# Note: This failure may have occurred because your default device\n"; + print "# was set using a non-concealed logical name. If this is the case,\n"; + print "# you will need to determine by inspection that the two resultant\n"; + print "# file specifications shwn above are in fact equivalent.\n"; +} +if (rmsexpand('from.here') eq "\L$ENV{DEFAULT}from.here") { + print 'ok ', ++$idx, "\n"; +} +else { + print 'not ok ', ++$idx, ": rmsexpand('from.here') = |", + rmsexpand('from.here'), + "|, \$ENV{DEFAULT}from.here = |\L$ENV{DEFAULT}from.here|\n"; + print "# Note: This failure may have occurred because your default device\n"; + print "# was set using a non-concealed logical name. If this is the case,\n"; + print "# you will need to determine by inspection that the two resultant\n"; + print "# file specifications shwn above are in fact equivalent.\n"; +} +if (rmsexpand('from.here','cant:[get.there];2') eq + 'cant:[get.there]from.here;2') { print 'ok ',++$idx,"\n"; } +else { + print 'not ok ', ++$idx, ': expected |cant:[get.there]from.here;2|, got |', + rmsexpand('from.here','cant:[get.there];2'),"|\n"; +} __DATA__ diff --git a/vms/sockadapt.c b/vms/sockadapt.c index e4c3dad213..b63e4c937b 100644 --- a/vms/sockadapt.c +++ b/vms/sockadapt.c @@ -29,18 +29,25 @@ # define __sockadapt_my_name_t char * #endif +/* We have these on VMS 7.0 and above, or on Dec C 5.6 if it's providing */ +/* the 7.0 DECC RTL */ +#if ((((__VMS_VER >= 70000000) && (__DECC_VER >= 50200000)) || (__CRTL_VER >= 70000000)) && defined(DECCRTL_SOCKETS)) +#else void setnetent(int stayopen) { croak("Function \"setnetent\" not implemented in this version of perl"); } void endnetent() { croak("Function \"endnetent\" not implemented in this version of perl"); } +#endif #if defined(DECCRTL_SOCKETS) /* Use builtin socket interface in DECCRTL and * UCX emulation in whatever TCP/IP stack is present. */ +#if ((__VMS_VER >= 70000000) && (__DECC_VER >= 50200000)) || (__CRTL_VER >= 70000000) +#else void sethostent(int stayopen) { croak("Function \"sethostent\" not implemented in this version of perl"); } @@ -67,6 +74,7 @@ void endnetent() { croak("Function \"getservent\" not implemented in this version of perl"); return (__sockadapt_my_servent_t )NULL; /* Avoid MISSINGRETURN warning, not reached */ } +#endif #else /* Work around things missing/broken in SOCKETSHR. */ diff --git a/vms/sockadapt.h b/vms/sockadapt.h index f24faea475..7f9150a579 100644 --- a/vms/sockadapt.h +++ b/vms/sockadapt.h @@ -24,6 +24,8 @@ # include <inet.h> # include <in.h> # include <netdb.h> +#if ((__VMS_VER >= 70000000) && (__DECC_VER >= 50200000)) || (__CRTL_VER >= 70000000) +#else void sethostent(int); void endhostent(void); void setnetent(int); @@ -32,6 +34,7 @@ void endprotoent(void); void setservent(int); void endservent(void); +#endif # if defined(__DECC) && defined(__DECC_VER) && (__DECC_VER >= 50200000) # define Sock_size_t unsigned int # endif diff --git a/vms/test.com b/vms/test.com index 50a98caf00..114cb24a40 100644 --- a/vms/test.com +++ b/vms/test.com @@ -6,6 +6,7 @@ $ $! A little basic setup $ On Error Then Goto wrapup $ olddef = F$Environment("Default") +$ oldmsg = F$Environment("Message") $ If F$Search("t.dir").nes."" $ Then $ Set Default [.t] @@ -18,6 +19,7 @@ $ Write Sys$Error "Can't find test directory" $ Exit 44 $ EndIf $ EndIf +$ Set Message /Facility/Severity/Identification/Text $ $ exe = ".Exe" $ If p1.nes."" Then exe = p1 @@ -87,12 +89,12 @@ $ Deck/Dollar=$$END-OF-TEST$$ # but the tests may use other operators which don't.) use Config; -@compexcl=('cpp.t','script.t'); +@compexcl=('cpp.t'); @ioexcl=('argv.t','dup.t','fs.t','inplace.t','pipe.t'); @libexcl=('anydbm.t','db-btree.t','db-hash.t','db-recno.t', 'gdbm.t','io_dup.t', 'io_pipe.t', 'io_sel.t', 'io_sock.t', 'ndbm.t','odbm.t','open2.t','open3.t','posix.t', - 'sdbm.t','soundex.t'); + 'sdbm.t'); # Note: POSIX is not part of basic build, but can be built # separately if you're using DECC @@ -218,4 +220,5 @@ $$END-OF-TEST$$ $ wrapup: $ If F$Search("Echo.Exe").nes."" Then Delete/Log/NoConfirm Echo.Exe;* $ Set Default &olddef +$ Set Message 'oldmsg' $ Exit @@ -456,9 +456,9 @@ kill_file(char *name) /*}}}*/ -/*{{{int my_mkdir(char *,mode_t)*/ +/*{{{int my_mkdir(char *,Mode_t)*/ int -my_mkdir(char *dir, mode_t mode) +my_mkdir(char *dir, Mode_t mode) { STRLEN dirlen = strlen(dir); @@ -1759,7 +1759,7 @@ static int background_process(int argc, char **argv); static void pipe_and_fork(char **cmargv); /*{{{ void getredirection(int *ac, char ***av)*/ -void +static void getredirection(int *ac, char ***av) /* * Process vms redirection arg's. Exit if any error is seen. @@ -2221,6 +2221,34 @@ unsigned long int flags = 17, one = 1, retsts; /*}}}*/ /***** End of code taken from Mark Pizzolato's argproc.c package *****/ + +/* OS-specific initialization at image activation (not thread startup) */ +/*{{{void vms_image_init(int *, char ***)*/ +void +vms_image_init(int *argcp, char ***argvp) +{ + unsigned long int *mask, iosb[2], i; + unsigned short int dummy; + union prvdef iprv; + struct itmlst_3 jpilist[2] = { {sizeof iprv, JPI$_IMAGPRIV, &iprv, &dummy}, + { 0, 0, 0, 0} }; + + _ckvmssts(sys$getjpiw(0,NULL,NULL,jpilist,iosb,NULL,NULL)); + _ckvmssts(iosb[0]); + mask = (unsigned long int *) &iprv; /* Quick change of view */; + for (i = 0; i < (sizeof iprv + sizeof(unsigned long int) - 1) / sizeof(unsigned long int); i++) { + if (mask[i]) { /* Running image installed with privs? */ + _ckvmssts(sys$setprv(0,&iprv,0,NULL)); /* Turn 'em off. */ + tainting = TRUE; + break; + } + } + getredirection(argcp,argvp); + return; +} +/*}}}*/ + + /* trim_unixpath() * Trim Unix-style prefix off filespec, so it looks like what a shell * glob expansion would return (i.e. from specified prefix on, not diff --git a/vms/vmsish.h b/vms/vmsish.h index 841b11993a..81e3764a2c 100644 --- a/vms/vmsish.h +++ b/vms/vmsish.h @@ -104,14 +104,13 @@ # define tounixpath_ts Perl_tounixpath_ts # define tovmspath Perl_tovmspath # define tovmspath_ts Perl_tovmspath_ts -# define getredirection Perl_getredirection +# define vms_image_init Perl_vms_image_init # define opendir Perl_opendir # define readdir Perl_readdir # define telldir Perl_telldir # define seekdir Perl_seekdir # define closedir Perl_closedir # define vmsreaddirversions Perl_vmsreaddirversions -# define getredirection Perl_getredirection # define my_gmtime Perl_my_gmtime # define my_localtime Perl_my_localtime # define my_time Perl_my_time @@ -226,7 +225,7 @@ #endif #define BIT_BUCKET "_NLA0:" -#define PERL_SYS_INIT(c,v) getredirection((c),(v)) +#define PERL_SYS_INIT(c,v) vms_image_init((c),(v)) #define PERL_SYS_TERM() #define dXSUB_SYS #define HAS_KILL @@ -500,7 +499,6 @@ typedef unsigned myino_t; #endif void prime_env_iter _((void)); -void getredirection _((int *, char ***)); void init_os_extras _(()); /* prototype section start marker; `typedef' passes through cpp */ typedef char __VMS_PROTOTYPES__; @@ -511,7 +509,7 @@ Pid_t my_waitpid _((Pid_t, int *, int)); char * my_gconvert _((double, int, int, char *)); int do_rmdir _((char *)); int kill_file _((char *)); -int my_mkdir _((char *, mode_t)); +int my_mkdir _((char *, Mode_t)); int my_utime _((char *, struct utimbuf *)); char * rmsexpand _((char *, char *, char *, unsigned)); char * rmsexpand_ts _((char *, char *, char *, unsigned)); @@ -527,7 +525,7 @@ char * tounixpath _((char *, char *)); char * tounixpath_ts _((char *, char *)); char * tovmspath _((char *, char *)); char * tovmspath_ts _((char *, char *)); -void getredirection _(()); +void vms_image_init _((int *, char ***)); DIR * opendir _((char *)); struct dirent * readdir _((DIR *)); long telldir _((DIR *)); |