summaryrefslogtreecommitdiff
path: root/vms
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1997-02-22 04:41:00 +1200
committerChip Salzenberg <chip@atlantic.net>1997-02-22 04:41:00 +1200
commitaa6893958c2bfb6fa4ab923c8466c188c65748fd (patch)
tree012b1f5dd2622b8c322606df0fa2de1a7ec582b1 /vms
parentd53f8f1cc3de155a009198bbc7c01e2741aa70ac (diff)
downloadperl-aa6893958c2bfb6fa4ab923c8466c188c65748fd.tar.gz
[inseparable changes from patch from perl5.003_27 to perl5.003_28]
CORE LANGUAGE CHANGES Subject: Don't let C<sub foo;> undefine &foo From: Chip Salzenberg <chip@perl.com> Files: op.c Subject: Make code, doc agree on $ENV{PATH} and `cmd` From: Chip Salzenberg <chip@perl.com> Files: pod/perlsec.pod pp_sys.c Subject: Optimize keys() and values() in void context From: Chip Salzenberg <chip@perl.com> Files: doop.c op.c CORE PORTABILITY Subject: VMS patches post _27 Date: Thu, 20 Feb 1997 01:58:46 -0500 (EST) From: Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU> Files: MANIFEST dosish.h hv.c lib/ExtUtils/MM_VMS.pm lib/ExtUtils/xsubpp perl.c perlsdio.h pod/perldelta.pod pod/perlvar.pod t/op/closure.t unixish.h vms/Makefile vms/descrip.mms vms/ext/filespec.t vms/genconfig.pl vms/vms.c vms/vmsish.h private-msgid: <01IFMEMPN1IU0057E2@hmivax.humgen.upenn.edu> Subject: Re: OS/2 patch for _27 Date: Thu, 20 Feb 1997 19:24:16 -0500 (EST) From: Ilya Zakharevich <ilya@math.ohio-state.edu> Files: INSTALL README.os2 lib/Test/Harness.pm os2/Changes os2/OS2/PrfDB/t/os2_prfdb.t os2/os2.c os2/os2ish.h os2/perl2cmd.pl perl.c pod/perldelta.pod t/TEST t/harness t/op/magic.t Msg-ID: <199702210024.TAA03174@monk.mps.ohio-state.edu> (applied based on p5p patch as commit 833d3f255ed68b969f062cec63d33f853ed9237c) DOCUMENTATION Subject: INSTALL updates since _26 Date: Tue, 18 Feb 1997 16:00:08 -0500 (EST) From: Andy Dougherty <doughera@fractal.phys.lafayette.edu> Files: INSTALL Msg-ID: <Pine.SOL.3.95q.970218155815.2014F-100000@fractal.lafayette.e (applied based on p5p patch as commit a8247d96fd6167a3b920e63aedee5592cd6e29a7) Subject: Document "$$0" change From: Chip Salzenberg <chip@perl.com> Files: pod/perldelta.pod Subject: Don't recommend impossible //o for C<$x =~ $y> From: Chip Salzenberg <chip@perl.com> Files: pod/perlop.pod Subject: Correct doc that claimed that <FH> was never false From: Chip Salzenberg <chip@perl.com> Files: pod/perldelta.pod pod/perlop.pod Subject: Document C<$?> vs. $SIG{CHLD} From: Ulrich Pfeifer <pfeifer@charly.informatik.uni-dortmund.de> Files: pod/perlvar.pod Subject: Add pumpkin.pod From: Chip Salzenberg <chip@perl.com> Files: MANIFEST Porting/pumpkin.pod Subject: Don't say "associat*ve arr*y" From: Chip Salzenberg <chip@perl.com> Files: MANIFEST gv.h hv.c lib/Env.pm lib/overload.pm opcode.pl pod/perl.pod pod/perldelta.pod pod/perldiag.pod pod/perlfunc.pod pod/perlguts.pod pod/perlmod.pod pod/perltie.pod pod/perltoc.pod pod/perltrap.pod x2p/a2p.pod OTHER CORE CHANGES Subject: Fix a typo From: Chip Salzenberg <chip@perl.com> Files: pp_sys.c Subject: Fix perl_call_sv(..., G_NOARGS) From: Chip Salzenberg <chip@perl.com> Files: perl.c Subject: Fix SIGSEGV when cloning sub with complex expression From: Chip Salzenberg <chip@perl.com> Files: op.c
Diffstat (limited to 'vms')
-rw-r--r--vms/descrip.mms17
-rw-r--r--vms/ext/filespec.t2
-rw-r--r--vms/genconfig.pl17
-rw-r--r--vms/vms.c59
-rw-r--r--vms/vmsish.h42
5 files changed, 78 insertions, 59 deletions
diff --git a/vms/descrip.mms b/vms/descrip.mms
index d3ac365eb2..183c33f2eb 100644
--- a/vms/descrip.mms
+++ b/vms/descrip.mms
@@ -546,7 +546,7 @@ IO : [.lib]IO.pm [.lib.IO]File.pm [.lib.IO]Handle.pm [.lib.IO]Pipe.pm [.lib.IO]S
# Rename catches problem with some DECC versions in which object file is
# placed in current default dir, not same one as source file.
[.x2p]$(DBG)a2p$(E) : [.x2p]a2p$(O), [.x2p]hash$(O), [.x2p]str$(O), [.x2p]util$(O), [.x2p]walk$(O)
- @ If F$Search("a2p$(O)").nes."" Then Rename/NoLog a2p$(O),hash$(O),str$(O),util$(O),walk$(O) [.x2p]
+ @ If F$Search("hash$(O)").nes."" Then Rename/NoLog hash$(O),str$(O),util$(O),walk$(O) [.x2p]
Link $(LINKFLAGS) /Exe=$(MMS$TARGET) $(MMS$SOURCE_LIST) $(CRTLOPTS)
# Accomodate buggy cpp in some version of DECC, which chokes on illegal
@@ -609,6 +609,10 @@ preplibrary : $(MINIPERL_EXE) $(LIBPREREQ) $(SOCKPM)
@ If F$Search("[.lib]pod.dir").eqs."" Then Create/Directory [.lib.pod]
@ Copy/Log $(MMS$SOURCE) $(MMS$TARGET)
+[.lib.pod]perldelta.pod : [.pod]perldelta.pod
+ @ If F$Search("[.lib]pod.dir").eqs."" Then Create/Directory [.lib.pod]
+ @ Copy/Log $(MMS$SOURCE) $(MMS$TARGET)
+
[.lib.pod]perldiag.pod : [.pod]perldiag.pod
@ If F$Search("[.lib]pod.dir").eqs."" Then Create/Directory [.lib.pod]
@ Copy/Log $(MMS$SOURCE) $(MMS$TARGET)
@@ -697,6 +701,10 @@ preplibrary : $(MINIPERL_EXE) $(LIBPREREQ) $(SOCKPM)
@ If F$Search("[.lib]pod.dir").eqs."" Then Create/Directory [.lib.pod]
@ Copy/Log $(MMS$SOURCE) $(MMS$TARGET)
+[.lib.pod]perltoot.pod : [.pod]perltoot.pod
+ @ If F$Search("[.lib]pod.dir").eqs."" Then Create/Directory [.lib.pod]
+ @ Copy/Log $(MMS$SOURCE) $(MMS$TARGET)
+
[.lib.pod]perltrap.pod : [.pod]perltrap.pod
@ If F$Search("[.lib]pod.dir").eqs."" Then Create/Directory [.lib.pod]
@ Copy/Log $(MMS$SOURCE) $(MMS$TARGET)
@@ -1640,7 +1648,6 @@ tidy : cleanlis
- If F$Search("[.Ext.DynaLoader]DL_VMS$(O);-1").nes."" Then Purge/NoConfirm/Log [.Ext.DynaLoader]DL_VMS$(O)
- If F$Search("[.Ext.DynaLoader]DL_VMS.C;-1").nes."" Then Purge/NoConfirm/Log [.Ext.DynaLoader]DL_VMS.C
- If F$Search("[.Ext.Opcode...];-1").nes."" Then Purge/NoConfirm/Log [.Ext.Opcode]
- - If F$Search("[.Ext.FileHandle...];-1").nes."" Then Purge/NoConfirm/Log [.Ext.FileHandle]
- If F$Search("[.VMS.Ext...]*.C;-1").nes."" Then Purge/NoConfirm/Log [.VMS.Ext...]*.C
- If F$Search("[.VMS.Ext...]*$(O);-1").nes."" Then Purge/NoConfirm/Log [.VMS.Ext...]*$(O)
- If F$Search("[.Lib.Auto...]*.al;-1").nes."" Then Purge/NoConfirm/Log [.Lib.Auto...]*.al
@@ -1663,9 +1670,6 @@ clean : tidy
Set Default [.ext.Fcntl]
- $(MMS) clean
Set Default [--]
- Set Default [.ext.FileHandle]
- - $(MMS) clean
- Set Default [--]
Set Default [.ext.IO]
- $(MMS) clean
Set Default [--]
@@ -1701,9 +1705,6 @@ realclean : clean
Set Default [.ext.Fcntl]
- $(MMS) realclean
Set Default [--]
- Set Default [.ext.FileHandle]
- - $(MMS) realclean
- Set Default [--]
Set Default [.ext.IO]
- $(MMS) realclean
Set Default [--]
diff --git a/vms/ext/filespec.t b/vms/ext/filespec.t
index a0a274bfee..62b06fe9ed 100644
--- a/vms/ext/filespec.t
+++ b/vms/ext/filespec.t
@@ -1,5 +1,7 @@
#!./perl
+BEGIN { unshift(@INC,'../lib') if -d '../lib'; }
+
use VMS::Filespec;
foreach (<DATA>) {
diff --git a/vms/genconfig.pl b/vms/genconfig.pl
index 6c3582216d..d2e514b1c9 100644
--- a/vms/genconfig.pl
+++ b/vms/genconfig.pl
@@ -78,10 +78,6 @@ ar=''
eunicefix=':'
hint='none'
hintfile=''
-intsize='4'
-longsize='4'
-shortsize='2'
-alignbytes='8'
shrplib='define'
usemymalloc='n'
usevfork='true'
@@ -256,13 +252,15 @@ while (<IN>) {
$val =~ s!\s*/\*.*!!; # strip off trailing comment
my($had_val); # Maybe a macro with args that we just #undefd or commented
if (!length($val) and $val_vars{$token} and ($un || $blocked)) {
- print OUT "$val_vars{$token}=''\n";
+ print OUT "$val_vars{$token}=''\n" unless exists $done{$val_vars{$token}};
+ $done{$val_vars{$token}}++;
delete $val_vars{$token};
$had_val = 1;
}
$state = ($blocked || $un) ? 'undef' : 'define';
if ($pp_vars{$token}) {
- print OUT "$pp_vars{$token}='$state'\n";
+ print OUT "$pp_vars{$token}='$state'\n" unless exists $done{$pp_vars{$token}};
+ $done{$pp_vars{$token}}++;
delete $pp_vars{$token};
}
elsif (not length $val and not $had_val) {
@@ -278,8 +276,11 @@ while (<IN>) {
# Library directory; convert to VMS syntax
$val = VMS::Filespec::vmspath($val) if ($token =~ /EXP$/);
if ($val_vars{$token}) {
- print OUT "$val_vars{$token}='$val'\n";
- if ($val_vars{$token} =~ s/exp$//) {print OUT "$val_vars{$token}='$val'\n";}
+ print OUT "$val_vars{$token}='$val'\n" unless exists $done{$val_vars{$token}};
+ if ($val_vars{$token} =~ s/exp$//) {
+ print OUT "$val_vars{$token}='$val'\n" unless exists $done{$val_vars{$token}};;
+ }
+ $done{$val_vars{$token}}++;
delete $val_vars{$token};
}
elsif (!$pp_vars{$token}) { # Haven't seen it previously, either
diff --git a/vms/vms.c b/vms/vms.c
index 98f34cef35..b54456918d 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -42,9 +42,9 @@
# define SS$_NOSUCHOBJECT 2696
#endif
-/* Don't intercept calls to vfork, since my_vfork below needs to
- * get to the underlying CRTL routine. */
-#define __DONT_MASK_VFORK
+/* Don't replace system definitions of vfork, getenv, and stat,
+ * code below needs to get to the underlying CRTL routines. */
+#define DONT_MASK_RTL_CALLS
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
@@ -333,7 +333,7 @@ do_rmdir(char *name)
{
char dirfile[NAM$C_MAXRSS+1];
int retval;
- struct stat st;
+ struct mystat st;
if (do_fileify_dirspec(name,dirfile,0) == NULL) return -1;
if (flex_stat(dirfile,&st) || !S_ISDIR(st.st_mode)) retval = -1;
@@ -2965,7 +2965,7 @@ struct passwd *my_getpwnam(char *name)
{
struct dsc$descriptor_s name_desc;
union uicdef uic;
- unsigned long int status, stat;
+ unsigned long int status, sts;
__pwdcache = __passwd_empty;
if (!fillpasswd(name, &__pwdcache)) {
@@ -2974,17 +2974,17 @@ struct passwd *my_getpwnam(char *name)
name_desc.dsc$b_dtype= DSC$K_DTYPE_T;
name_desc.dsc$b_class= DSC$K_CLASS_S;
name_desc.dsc$a_pointer= (char *) name;
- if ((stat = sys$asctoid(&name_desc, &uic, 0)) == SS$_NORMAL) {
+ if ((sts = sys$asctoid(&name_desc, &uic, 0)) == SS$_NORMAL) {
__pwdcache.pw_uid= uic.uic$l_uic;
__pwdcache.pw_gid= uic.uic$v_group;
}
else {
- if (stat == SS$_NOSUCHID || stat == SS$_IVIDENT || stat == RMS$_PRV) {
- set_vaxc_errno(stat);
- set_errno(stat == RMS$_PRV ? EACCES : EINVAL);
+ if (sts == SS$_NOSUCHID || sts == SS$_IVIDENT || sts == RMS$_PRV) {
+ set_vaxc_errno(sts);
+ set_errno(sts == RMS$_PRV ? EACCES : EINVAL);
return NULL;
}
- else { _ckvmssts(stat); }
+ else { _ckvmssts(sts); }
}
}
strncpy(__pw_namecache, name, sizeof(__pw_namecache));
@@ -3388,11 +3388,11 @@ int my_utime(char *file, struct utimbuf *utimes)
* on the first call.
*/
#define LOCKID_MASK 0x80000000 /* Use 0 to force device name use only */
-static dev_t encode_dev (const char *dev)
+static mydev_t encode_dev (const char *dev)
{
int i;
unsigned long int f;
- dev_t enc;
+ mydev_t enc;
char c;
const char *q;
@@ -3456,14 +3456,15 @@ is_null_device(name)
/* Do the permissions allow some operation? Assumes statcache already set. */
/* Do this via $Check_Access on VMS, since the CRTL stat() returns only a
- * subset of the applicable information.
+ * subset of the applicable information. (We have to stick with struct
+ * stat instead of struct mystat in the prototype since we have to match
+ * the one in proto.h.)
*/
/*{{{I32 cando(I32 bit, I32 effective, struct stat *statbufp)*/
I32
cando(I32 bit, I32 effective, struct stat *statbufp)
{
- if (statbufp == &statcache)
- return cando_by_name(bit,effective,namecache);
+ if (statbufp == &statcache) return cando_by_name(bit,effective,namecache);
else {
char fname[NAM$C_MAXRSS+1];
unsigned long int retsts;
@@ -3472,13 +3473,13 @@ cando(I32 bit, I32 effective, struct stat *statbufp)
/* If the struct mystat is stale, we're OOL; stat() overwrites the
device name on successive calls */
- devdsc.dsc$a_pointer = statbufp->st_devnam;
- devdsc.dsc$w_length = strlen(statbufp->st_devnam);
+ devdsc.dsc$a_pointer = ((struct mystat *)statbufp)->st_devnam;
+ devdsc.dsc$w_length = strlen(((struct mystat *)statbufp)->st_devnam);
namdsc.dsc$a_pointer = fname;
namdsc.dsc$w_length = sizeof fname - 1;
- retsts = lib$fid_to_name(&devdsc,&(statbufp->st_ino),&namdsc,
- &namdsc.dsc$w_length,0,0);
+ retsts = lib$fid_to_name(&devdsc,&(((struct mystat *)statbufp)->st_ino),
+ &namdsc,&namdsc.dsc$w_length,0,0);
if (retsts & 1) {
fname[namdsc.dsc$w_length] = '\0';
return cando_by_name(bit,effective,fname);
@@ -3589,13 +3590,12 @@ cando_by_name(I32 bit, I32 effective, char *fname)
/*}}}*/
-/*{{{ int flex_fstat(int fd, struct stat *statbuf)*/
-#undef stat
+/*{{{ int flex_fstat(int fd, struct mystat *statbuf)*/
int
flex_fstat(int fd, struct mystat *statbufp)
{
if (!fstat(fd,(stat_t *) statbufp)) {
- if (statbufp == &statcache) *namecache == '\0';
+ if (statbufp == (struct mystat *) &statcache) *namecache == '\0';
statbufp->st_dev = encode_dev(statbufp->st_devnam);
# ifdef VMSISH_TIME
if (!VMSISH_TIME) { /* Return UTC instead of local time */
@@ -3614,19 +3614,15 @@ flex_fstat(int fd, struct mystat *statbufp)
} /* end of flex_fstat() */
/*}}}*/
-/*{{{ int flex_stat(char *fspec, struct stat *statbufp)*/
-/* We defined 'stat' as 'mystat' in vmsish.h so that declarations of
- * 'struct stat' elsewhere in Perl would use our struct. We go back
- * to the system version here, since we're actually calling their
- * stat().
- */
+/*{{{ int flex_stat(char *fspec, struct mystat *statbufp)*/
int
flex_stat(char *fspec, struct mystat *statbufp)
{
char fileified[NAM$C_MAXRSS+1];
int retval = -1;
- if (statbufp == &statcache) do_tovmsspec(fspec,namecache,0);
+ if (statbufp == (struct mystat *) &statcache)
+ do_tovmsspec(fspec,namecache,0);
if (is_null_device(fspec)) { /* Fake a stat() for the null device */
memset(statbufp,0,sizeof *statbufp);
statbufp->st_dev = encode_dev("_NLA0:");
@@ -3648,7 +3644,8 @@ flex_stat(char *fspec, struct mystat *statbufp)
*/
if (do_fileify_dirspec(fspec,fileified,0) != NULL) {
retval = stat(fileified,(stat_t *) statbufp);
- if (!retval && statbufp == &statcache) strcpy(namecache,fileified);
+ if (!retval && statbufp == (struct mystat *) &statcache)
+ strcpy(namecache,fileified);
}
if (retval) retval = stat(fspec,(stat_t *) statbufp);
if (!retval) {
@@ -3667,8 +3664,6 @@ flex_stat(char *fspec, struct mystat *statbufp)
return retval;
} /* end of flex_stat() */
-/* Reset definition for later calls */
-#define stat mystat
/*}}}*/
/* Insures that no carriage-control translation will be done on a file. */
diff --git a/vms/vmsish.h b/vms/vmsish.h
index cab319dc04..61543415e2 100644
--- a/vms/vmsish.h
+++ b/vms/vmsish.h
@@ -2,8 +2,8 @@
*
* VMS-specific C header file for perl5.
*
- * Last revised: 01-Oct-1995 by Charles Bailey bailey@genetics.upenn.edu
- * Version: 5.1.6
+ * Last revised: 18-Feb-1997 by Charles Bailey bailey@genetics.upenn.edu
+ * Version: 5.3.28
*/
#ifndef __vmsish_h_included
@@ -56,6 +56,18 @@
# include <unistd.h> /* DECC has this; VAXC and gcc don't */
#endif
+#ifdef NO_PERL_TYPEDEFS /* a2p; we don't want Perl's special routines */
+# define DONT_MASK_RTL_CALLS
+#endif
+
+ /* defined for vms.c so we can see CRTL | defined for a2p */
+#ifndef DONT_MASK_RTL_CALLS
+# ifdef getenv
+# undef getenv
+# endif
+# define getenv(v) my_getenv(v) /* getenv used for regular logical names */
+#endif
+
/* DECC introduces this routine in the RTL as of VMS 7.0; for now,
* we'll use ours, since it gives us the full VMS exit status. */
#ifdef __PID_T
@@ -130,7 +142,7 @@
* exec should be handled in VMSish or Unixish style.
*/
#define fork my_vfork
-#ifndef __DONT_MASK_VFORK /* #defined in vms.c so we see real vfork */
+#ifndef DONT_MASK_RTL_CALLS /* #defined in vms.c so we see real vfork */
# ifdef vfork
# undef vfork
# endif
@@ -181,13 +193,13 @@
#define COMPLEX_STATUS 1 /* We track both "POSIX" and VMS values */
-#define HINT_S_VMSISH 24
+#define HINT_V_VMSISH 24
#define HINT_M_VMSISH_STATUS 0x01000000 /* system, $? return VMS status */
#define HINT_M_VMSISH_EXIT 0x02000000 /* exit(1) ==> SS$_NORMAL */
#define HINT_M_VMSISH_TIME 0x04000000 /* times are local, not UTC */
-#define NATIVE_HINTS (hints >> HINT_S_VMSISH) /* used in op.c */
+#define NATIVE_HINTS (hints >> HINT_V_VMSISH) /* used in op.c */
-#define TEST_VMSISH(h) (curcop->op_private & ((h) >> HINT_S_VMSISH))
+#define TEST_VMSISH(h) (curcop->op_private & ((h) >> HINT_V_VMSISH))
#define VMSISH_STATUS TEST_VMSISH(HINT_M_VMSISH_STATUS)
#define VMSISH_EXIT TEST_VMSISH(HINT_M_VMSISH_EXIT)
#define VMSISH_TIME TEST_VMSISH(HINT_M_VMSISH_TIME)
@@ -327,6 +339,9 @@ struct utimbuf {
/* Look up new %ENV values on the fly */
#define DYNAMIC_ENV_FETCH 1
#define ENV_HV_NAME "%EnV%VmS%"
+ /* Special getenv function for retrieving %ENV elements. */
+#define ENV_getenv(v) my_getenv(v)
+
/* Thin jacket around cuserid() tomatch Unix' calling sequence */
#define getlogin my_getlogin
@@ -430,11 +445,16 @@ struct mystat
char st_fab_fsz; /* fixed header size */
unsigned st_dev; /* encoded device name */
};
-#define stat mystat
typedef unsigned mydev_t;
-#define dev_t mydev_t
typedef unsigned myino_t;
-#define ino_t myino_t
+#ifndef DONT_MASK_RTL_CALLS /* defined for vms.c so we can see RTL calls */
+# ifdef stat
+# undef stat
+# endif
+# define stat mystat
+# define dev_t mydev_t
+# define ino_t myino_t
+#endif
#if defined(__DECC) || defined(__DECCXX)
# pragma __member_alignment __restore
#endif
@@ -513,8 +533,8 @@ struct tm * my_gmtime _((const time_t *));
struct tm * my_localtime _((const time_t *));
time_t my_time _((time_t *));
I32 cando_by_name _((I32, I32, char *));
-int flex_fstat _((int, struct stat *));
-int flex_stat _((char *, struct stat *));
+int flex_fstat _((int, struct mystat *));
+int flex_stat _((char *, struct mystat *));
int trim_unixpath _((char *, char*, int));
int my_vfork _(());
bool vms_do_aexec _((SV *, SV **, SV **));