From: Jarkko Hietaniemi Date: Sun, 21 Nov 1999 14:05:10 +0000 (+0000) Subject: VMS patches from Peter Prymmer. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a52cb5f71fdb108349442902e9c003c02608aae2;p=p5sagit%2Fp5-mst-13.2.git VMS patches from Peter Prymmer. p4raw-id: //depot/cfgperl@4595 --- diff --git a/doio.c b/doio.c index f023ebd..4a255b2 100644 --- a/doio.c +++ b/doio.c @@ -168,7 +168,7 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw, if (fd == -1) fp = NULL; else { - const char *fpmode; + char *fpmode; if (result == O_RDONLY) fpmode = "r"; #ifdef O_APPEND diff --git a/mg.c b/mg.c index fdaf3bb..35d73dd 100644 --- a/mg.c +++ b/mg.c @@ -665,11 +665,15 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) break; case '(': sv_setiv(sv, (IV)PL_gid); +#ifdef HAS_GETGROUPS Perl_sv_setpvf(aTHX_ sv, "%"Gid_t_f, PL_gid); +#endif goto add_groups; case ')': sv_setiv(sv, (IV)PL_egid); +#ifdef HAS_GETGROUPS Perl_sv_setpvf(aTHX_ sv, "%"Gid_t_f, PL_egid); +#endif add_groups: #ifdef HAS_GETGROUPS { diff --git a/taint.c b/taint.c index 24fd487..0f0ce98 100644 --- a/taint.c +++ b/taint.c @@ -14,8 +14,10 @@ Perl_taint_proper(pTHX_ const char *f, const char *s) dTHR; /* just for taint */ char *ug; +#ifdef HAS_SETEUID DEBUG_u(PerlIO_printf(Perl_debug_log, "%s %d %"Uid_t_f" %"Uid_t_f"\n", s, PL_tainted, PL_uid, PL_euid)); +#endif if (PL_tainted) { if (!f) diff --git a/vms/subconfigure.com b/vms/subconfigure.com index 79fa00f..93473dc 100644 --- a/vms/subconfigure.com +++ b/vms/subconfigure.com @@ -465,7 +465,6 @@ $ perl_sPRIx64 = "" $ perl_d_quad = "undef" $ ENDIF $! -$! $! Now some that we build up $! $ LocalTime = f$time() @@ -559,6 +558,7 @@ $ DEASSIGN SYS$ERROR $ OPEN/READ TEMPOUT [-.uu]tempout.lis $ READ TEMPOUT line $ CLOSE TEMPOUT +$ DELETE/NOLOG [-.uu]tempout.lis; $ $ perl_cpp_stuff=line $ WRITE_RESULT "cpp_stuff is ''perl_cpp_stuff'" @@ -589,7 +589,6 @@ $ link temp.obj,temp.opt/opt $ else $ link temp.obj $ endif -$! link temp.obj $ OPEN/WRITE TEMPOUT [-.uu]tempout.lis $ DEASSIGN SYS$OUTPUT $ DEASSIGN SYS$ERROR @@ -602,6 +601,7 @@ $ DEASSIGN SYS$ERROR $ OPEN/READ TEMPOUT [-.uu]tempout.lis $ READ TEMPOUT line $ CLOSE TEMPOUT +$ DELETE/NOLOG [-.uu]tempout.lis; $ $ perl_doublesize=line $ WRITE_RESULT "doublesize is ''perl_doublesize'" @@ -656,6 +656,7 @@ $ DEASSIGN SYS$ERROR $ OPEN/READ TEMPOUT [-.uu]tempout.lis $ READ TEMPOUT line $ CLOSE TEMPOUT +$ DELETE/NOLOG [-.uu]tempout.lis; $ $ perl_longdblsize=line $ perl_d_longdbl="define" @@ -706,141 +707,13 @@ $ DEASSIGN SYS$ERROR $ OPEN/READ TEMPOUT [-.uu]tempout.lis $ READ TEMPOUT line $ CLOSE TEMPOUT -$ +$ DELETE/NOLOG [-.uu]tempout.lis; $ perl_longlongsize=line $ perl_d_longlong="define" $ ENDIF $ WRITE_RESULT "longlongsize is ''perl_longlongsize'" $ WRITE_RESULT "d_longlong is ''perl_d_longlong'" $! -$! Check for int size -$! -$ OS -$ WS "#ifdef __DECC -$ WS "#include -$ WS "#endif -$ WS "#include -$ WS "int main() -$ WS "{" -$ WS "printf(""%d\n"", sizeof(int)); -$ WS "exit(0); -$ WS "}" -$ CS -$ DEFINE SYS$ERROR _NLA0: -$ DEFINE SYS$OUTPUT _NLA0: -$ on error then continue -$ on warning then continue -$ 'Checkcc' temp.c -$ If (Needs_Opt.eqs."Yes") -$ THEN -$ link temp.obj,temp.opt/opt -$ else -$ link temp.obj -$ endif -$ If (Needs_Opt.eqs."Yes") -$ THEN -$ link temp.obj,temp.opt/opt -$ else -$ link temp.obj -$ endif -$ OPEN/WRITE TEMPOUT [-.uu]tempout.lis -$ DEASSIGN SYS$OUTPUT -$ DEASSIGN SYS$ERROR -$ DEFINE SYS$ERROR TEMPOUT -$ DEFINE SYS$OUTPUT TEMPOUT -$ mcr []temp -$ CLOSE TEMPOUT -$ DEASSIGN SYS$OUTPUT -$ DEASSIGN SYS$ERROR -$ OPEN/READ TEMPOUT [-.uu]tempout.lis -$ READ TEMPOUT line -$ CLOSE TEMPOUT -$ -$ perl_intsize=line -$ WRITE_RESULT "intsize is ''perl_intsize'" -$! -$! Check for short size -$! -$ OS -$ WS "#ifdef __DECC -$ WS "#include -$ WS "#endif -$ WS "#include -$ WS "int main() -$ WS "{" -$ WS "printf(""%d\n"", sizeof(short)); -$ WS "exit(0); -$ WS "}" -$ CS -$ DEFINE SYS$ERROR _NLA0: -$ DEFINE SYS$OUTPUT _NLA0: -$ on error then continue -$ on warning then continue -$ 'Checkcc' temp.c -$ If (Needs_Opt.eqs."Yes") -$ THEN -$ link temp.obj,temp.opt/opt -$ else -$ link temp.obj -$ endif -$ OPEN/WRITE TEMPOUT [-.uu]tempout.lis -$ DEASSIGN SYS$OUTPUT -$ DEASSIGN SYS$ERROR -$ DEFINE SYS$ERROR TEMPOUT -$ DEFINE SYS$OUTPUT TEMPOUT -$ mcr []temp -$ CLOSE TEMPOUT -$ DEASSIGN SYS$OUTPUT -$ DEASSIGN SYS$ERROR -$ OPEN/READ TEMPOUT [-.uu]tempout.lis -$ READ TEMPOUT line -$ CLOSE TEMPOUT -$ -$ perl_shortsize=line -$ WRITE_RESULT "shortsize is ''perl_shortsize'" -$! -$! Check for long size -$! -$ OS -$ WS "#ifdef __DECC -$ WS "#include -$ WS "#endif -$ WS "#include -$ WS "int main() -$ WS "{" -$ WS "int foo; -$ WS "foo = sizeof(long); -$ WS "printf(""%d\n"", foo); -$ WS "exit(0); -$ WS "}" -$ CS -$ DEFINE SYS$ERROR _NLA0: -$ DEFINE SYS$OUTPUT _NLA0: -$ on error then continue -$ on warning then continue -$ 'Checkcc' temp.c -$ If (Needs_Opt.eqs."Yes") -$ THEN -$ link temp.obj,temp.opt/opt -$ else -$ link temp.obj -$ endif -$ OPEN/WRITE TEMPOUT [-.uu]tempout.lis -$ DEASSIGN SYS$OUTPUT -$ DEASSIGN SYS$ERROR -$ DEFINE SYS$ERROR TEMPOUT -$ DEFINE SYS$OUTPUT TEMPOUT -$ mcr []temp -$ CLOSE TEMPOUT -$ DEASSIGN SYS$OUTPUT -$ DEASSIGN SYS$ERROR -$ OPEN/READ TEMPOUT [-.uu]tempout.lis -$ READ TEMPOUT line -$ CLOSE TEMPOUT -$ -$ perl_longsize=line -$ WRITE_RESULT "longsize is ''perl_longsize'" -$! $! Check the prototype for getgid $! $ OS @@ -2789,36 +2662,34 @@ $ WS "printf(""%d\n"", foo); $ WS "exit(0); $ WS "}" $ CS -$! copy temp.c sys$output -$! -$ DEFINE SYS$ERROR _NLA0: -$ DEFINE SYS$OUTPUT _NLA0: -$ ON ERROR THEN CONTINUE -$ ON WARNING THEN CONTINUE -$ 'Checkcc' temp.c -$ If (Needs_Opt.eqs."Yes") -$ THEN -$ link temp.obj,temp.opt/opt -$ else -$ link temp.obj -$ endif -$ OPEN/WRITE TEMPOUT [-.uu]tempout.lis -$ DEASSIGN SYS$OUTPUT -$ DEASSIGN SYS$ERROR -$ DEFINE SYS$ERROR TEMPOUT -$ DEFINE SYS$OUTPUT TEMPOUT -$ mcr []temp -$ CLOSE TEMPOUT -$ DEASSIGN SYS$OUTPUT -$ DEASSIGN SYS$ERROR -$ OPEN/READ TEMPOUT [-.uu]tempout.lis -$ READ TEMPOUT line -$ CLOSE TEMPOUT +$ DEFINE SYS$ERROR _NLA0: +$ DEFINE SYS$OUTPUT _NLA0: +$ ON ERROR THEN CONTINUE +$ ON WARNING THEN CONTINUE +$ 'Checkcc' temp.c +$ If (Needs_Opt.eqs."Yes") +$ THEN +$ link temp.obj,temp.opt/opt +$ ELSE +$ link temp.obj +$ ENDIF +$ OPEN/WRITE TEMPOUT [-.uu]tempout.lis +$ DEASSIGN SYS$OUTPUT +$ DEASSIGN SYS$ERROR +$ DEFINE SYS$ERROR TEMPOUT +$ DEFINE SYS$OUTPUT TEMPOUT +$ mcr []temp.exe +$ CLOSE TEMPOUT +$ DEASSIGN SYS$OUTPUT +$ DEASSIGN SYS$ERROR +$ OPEN/READ TEMPOUT [-.uu]tempout.lis +$ READ TEMPOUT line +$ CLOSE TEMPOUT +$ DELETE/NOLOG [-.uu]tempout.lis; $ $ perl_ptrsize=line $ WRITE_RESULT "ptrsize is ''perl_ptrsize'" $! -$! $! Check rand48 and its ilk $! $ OS @@ -2832,7 +2703,6 @@ $ WS "srand48(12L);" $ WS "exit(0); $ WS "}" $ CS -$! copy temp.c sys$output $! $ DEFINE SYS$ERROR _NLA0: $ DEFINE SYS$OUTPUT _NLA0: @@ -2998,7 +2868,6 @@ $ THEN $ perl_vms_cc_type="vaxc" $ ENDIF $! -$! $! Sockets? $ if ("''Has_Socketshr'".EQS."T").OR.("''Has_Dec_C_Sockets'".EQS."T") $ THEN @@ -3062,6 +2931,146 @@ $ $ perl_d_pthreads_created_joinable="undef" $ ENDIF $! +$! new (5.005_62++) typedefs for primitives +$! +$ perl_ivtype="long" +$ perl_uvtype="unsigned long" +$ perl_i8type="char" +$ perl_u8type="unsigned char" +$ perl_i16type="short" +$ perl_u16type="unsigned short" +$ perl_i32type="int" +$ perl_u32type="unsigned int" +$ perl_i64type="long" +$ perl_u64type="unsigned long" +$ perl_nvtype="double" +$! +$ GOTO beyond_type_size_check +$! +$type_size_check: +$! +$! Check for type sizes +$! +$ OS +$ WS "#ifdef __DECC +$ WS "#include +$ WS "#endif +$ WS "#include +$ WS "int main() +$ WS "{" +$ WS "printf(""%d\n"", sizeof(''type'));" +$ WS "exit(0); +$ WS "}" +$ CS +$ DEFINE SYS$ERROR _NLA0: +$ DEFINE SYS$OUTPUT _NLA0: +$ ON ERROR THEN CONTINUE +$ ON WARNING THEN CONTINUE +$ 'Checkcc' temp.c +$ If (Needs_Opt.eqs."Yes") +$ THEN +$ link temp.obj,temp.opt/opt +$ ELSE +$ link temp.obj +$ ENDIF +$ OPEN/WRITE TEMPOUT [-.uu]tempout.lis +$ DEASSIGN SYS$OUTPUT +$ DEASSIGN SYS$ERROR +$ DEFINE SYS$ERROR TEMPOUT +$ DEFINE SYS$OUTPUT TEMPOUT +$ mcr []temp.exe +$ CLOSE TEMPOUT +$ DEASSIGN SYS$OUTPUT +$ DEASSIGN SYS$ERROR +$ OPEN/READ TEMPOUT [-.uu]tempout.lis +$ READ TEMPOUT line +$ CLOSE TEMPOUT +$ DELETE/NOLOG [-.uu]tempout.lis; +$ WRITE_RESULT "''size_name' is ''line'" +$ DS +$ RETURN +$! +$beyond_type_size_check: +$! +$ line = "" +$ type = "''perl_ivtype'" +$ size_name = "ivsize" +$ gosub type_size_check +$ perl_ivsize="''line'" +$ IF type .eqs. "long" +$ THEN perl_longsize = "''line'" +$ ELSE +$ type = "long" +$ size_name = "longsize" +$ gosub type_size_check +$ perl_longsize="''line'" +$ ENDIF +$ +$ type = "''perl_uvtype'" +$ size_name = "uvsize" +$ gosub type_size_check +$ perl_uvsize="''line'" +$ +$ type = "''perl_i8type'" +$ size_name = "i8size" +$ gosub type_size_check +$ perl_i8size="''line'" +$ +$ type = "''perl_u8type'" +$ size_name = "u8size" +$ gosub type_size_check +$ perl_u8size="''line'" +$ +$ type = "''perl_i16type'" +$ size_name = "i16size" +$ gosub type_size_check +$ perl_i16size="''line'" +$ IF type .eqs. "short" +$ THEN perl_shortsize="''line'" +$ ELSE +$ type = "''perl_i16type'" +$ size_name = "shortsize" +$ gosub type_size_check +$ perl_shortsize="''line'" +$ ENDIF +$ +$ type = "''perl_u16type'" +$ size_name = "u16size" +$ gosub type_size_check +$ perl_u16size="''line'" +$ +$ type = "''perl_i32type'" +$ size_name = "i32size" +$ gosub type_size_check +$ perl_i32size="''line'" +$ IF type .eqs. "int" +$ THEN perl_intsize="''perl_i32size'" +$ ELSE +$ type = "int" +$ size_name = "intsize" +$ gosub type_size_check +$ perl_intsize="''line'" +$ ENDIF +$ +$ type = "''perl_u32type'" +$ size_name = "u32size" +$ gosub type_size_check +$ perl_u32size="''line'" +$ +$ type = "''perl_i64type'" +$ size_name = "i64size" +$ gosub type_size_check +$ perl_i64size="''line'" +$ +$ type = "''perl_u64type'" +$ size_name = "u64size" +$ gosub type_size_check +$ perl_u64size="''line'" +$! +$ perl_ivdformat="""ld""" +$ perl_uvuformat="""lu""" +$ perl_uvoformat="""lo""" +$ perl_uvxformat="""lx""" $! $! Finally the composite ones. All config $ perl_installarchlib="''perl_prefix':[lib.''perl_arch'.''localperlver']" @@ -3460,6 +3469,7 @@ $ WC "d_oldpthreads='" + perl_d_oldpthreads + "'" $ WC "d_longdbl='" + perl_d_longdbl + "'" $ WC "longdblsize='" + perl_longdblsize + "'" $ WC "d_longlong='" + perl_d_longlong + "'" +$ WC "uselonglong='" + perl_d_longlong + "'" $ WC "longlongsize='" + perl_longlongsize + "'" $ WC "d_mkstemp='" + perl_d_mkstemp + "'" $ WC "d_setvbuf='" + perl_d_setvbuf + "'" @@ -3589,9 +3599,9 @@ $ WC "sPRIu64='" + perl_sPRIu64 + "'" $ WC "sPRIo64='" + perl_sPRIo64 + "'" $ WC "sPRIx64='" + perl_sPRIx64 + "'" $ WC "d_llseek='" + perl_d_llseek + "'" -$ WC "d_uselargefiles='" + perl_uselargefiles + "'" -$ WC "d_uselongdouble='" + perl_uselongdouble + "'" -$ WC "d_usemorebits='" + perl_usemorebits + "'" +$ WC "uselargefiles='" + perl_uselargefiles + "'" +$ WC "uselongdouble='" + perl_uselongdouble + "'" +$ WC "usemorebits='" + perl_usemorebits + "'" $ WC "d_quad='" + perl_d_quad + "'" $ if (use_64bit .eqs. "Y") $ THEN @@ -3607,6 +3617,31 @@ $ WC "d_ustat='" + perl_d_ustat + "'" $ WC "i_sysstatfs='" + perl_i_sysstatfs + "'" $ WC "i_sysvfs='" + perl_i_sysvfs + "'" $ WC "i_ustat='" + perl_i_ustat + "'" +$ WC "ivtype='" + perl_ivtype + "'" +$ WC "uvtype='" + perl_uvtype + "'" +$ WC "i8type='" + perl_i8type + "'" +$ WC "i16type='" + perl_i16type + "'" +$ WC "u8type='" + perl_u8type + "'" +$ WC "u16type='" + perl_u16type + "'" +$ WC "i32type='" + perl_i32type + "'" +$ WC "u32type='" + perl_u32type + "'" +$ WC "i64type='" + perl_i64type + "'" +$ WC "u64type='" + perl_u64type + "'" +$ WC "nvtype='" + perl_nvtype + "'" +$ WC "ivsize='" + perl_ivsize + "'" +$ WC "uvsize='" + perl_uvsize + "'" +$ WC "i8size='" + perl_i8size + "'" +$ WC "u8size='" + perl_u8size + "'" +$ WC "i16size='" + perl_i16size + "'" +$ WC "u16size='" + perl_u16size + "'" +$ WC "i32size='" + perl_i32size + "'" +$ WC "u32size='" + perl_u32size + "'" +$ WC "i64size='" + perl_i64size + "'" +$ WC "u64size='" + perl_u64size + "'" +$ WC "ivdformat='" + perl_ivdformat + "'" +$ WC "uvuformat='" + perl_uvuformat + "'" +$ WC "uvoformat='" + perl_uvoformat + "'" +$ WC "uvxformat='" + perl_uvxformat + "'" $! $! ##WRITE NEW CONSTANTS HERE## $! diff --git a/vms/vms.c b/vms/vms.c index da76c35..aee410d 100644 --- a/vms/vms.c +++ b/vms/vms.c @@ -4401,9 +4401,8 @@ is_null_device(name) /* Do this via $Check_Access on VMS, since the CRTL stat() returns only a * subset of the applicable information. */ -/*{{{I32 cando(I32 bit, Uid_t effective, struct stat *statbufp)*/ -I32 -Perl_cando(pTHX_ I32 bit, Uid_t effective, Stat_t *statbufp) +bool +Perl_cando(pTHX_ Mode_t bit, Uid_t effective, Stat_t *statbufp) { if (statbufp == &PL_statcache) return cando_by_name(bit,effective,namecache); else {