summaryrefslogtreecommitdiff
path: root/vms
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-11-29 16:08:03 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-11-29 16:08:03 +0000
commit2d8e6c8d50eaf50f663a5fd184404c73944226e0 (patch)
treee5592e6ebd4ebedeee8ebc8ddbb60cad5f477fc4 /vms
parentb099ddc068b2498767e6f04ac167d9633b895ec4 (diff)
downloadperl-2d8e6c8d50eaf50f663a5fd184404c73944226e0.tar.gz
another threads reliability fix: serialize writes to thr->threadsv
avoid most uses of PL_na (which is much more inefficient than a simple local); update docs to suit; PL_na now being thr->Tna may be a minor compatibility issue for extensions--will require dTHR outside of XSUBs (those get automatic dTHR) p4raw-id: //depot/perl@2387
Diffstat (limited to 'vms')
-rw-r--r--vms/ext/Stdio/Stdio.xs9
-rw-r--r--vms/perly_c.vms2
-rw-r--r--vms/vms.c34
3 files changed, 29 insertions, 16 deletions
diff --git a/vms/ext/Stdio/Stdio.xs b/vms/ext/Stdio/Stdio.xs
index 6fa1b29bbe..53b491575d 100644
--- a/vms/ext/Stdio/Stdio.xs
+++ b/vms/ext/Stdio/Stdio.xs
@@ -164,11 +164,12 @@ setdef(...)
struct FAB deffab = cc$rms_fab;
struct NAM defnam = cc$rms_nam;
struct dsc$descriptor_s dirdsc = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0};
+ STRLEN n_a;
if (items) {
SV *defsv = ST(items-1); /* mimic chdir() */
ST(0) = &PL_sv_undef;
if (!SvPOK(defsv)) { SETERRNO(EINVAL,LIB$_INVARG); XSRETURN(1); }
- if (tovmsspec(SvPV(defsv,PL_na),vmsdef) == NULL) { XSRETURN(1); }
+ if (tovmsspec(SvPV(defsv,n_a),vmsdef) == NULL) { XSRETURN(1); }
deffab.fab$l_fna = vmsdef; deffab.fab$b_fns = strlen(vmsdef);
}
else {
@@ -232,6 +233,7 @@ vmsopen(spec,...)
char *args[8],mode[3] = {'r','\0','\0'}, type = '<';
register int i, myargc;
FILE *fp;
+ STRLEN n_a;
if (!spec || !*spec) {
SETERRNO(EINVAL,LIB$_INVARG);
@@ -250,7 +252,7 @@ vmsopen(spec,...)
}
else if (*spec == '<') spec++;
myargc = items - 1;
- for (i = 0; i < myargc; i++) args[i] = SvPV(ST(i+1),PL_na);
+ for (i = 0; i < myargc; i++) args[i] = SvPV(ST(i+1),n_a);
/* This hack brought to you by C's opaque arglist management */
switch (myargc) {
case 0:
@@ -298,13 +300,14 @@ vmssysopen(spec,mode,perm,...)
int i, myargc, fd;
FILE *fp;
SV *fh;
+ STRLEN n_a;
if (!spec || !*spec) {
SETERRNO(EINVAL,LIB$_INVARG);
XSRETURN_UNDEF;
}
if (items > 11) croak("too many args");
myargc = items - 3;
- for (i = 0; i < myargc; i++) args[i] = SvPV(ST(i+3),PL_na);
+ for (i = 0; i < myargc; i++) args[i] = SvPV(ST(i+3),n_a);
/* More fun with C calls; can't combine with above because
args 2,3 of different types in fopen() and open() */
switch (myargc) {
diff --git a/vms/perly_c.vms b/vms/perly_c.vms
index db1f255c56..2fc17813f6 100644
--- a/vms/perly_c.vms
+++ b/vms/perly_c.vms
@@ -1775,7 +1775,7 @@ case 56:
break;
case 57:
#line 302 "perly.y"
-{ char *name = SvPV(((SVOP*)yyvsp[0].opval)->op_sv, PL_na);
+{ STRLEN n_a; char *name = SvPV(((SVOP*)yyvsp[0].opval)->op_sv, n_a);
if (strEQ(name, "BEGIN") || strEQ(name, "END")
|| strEQ(name, "INIT"))
CvUNIQUE_on(PL_compcv);
diff --git a/vms/vms.c b/vms/vms.c
index 6bfbe3c607..bc09b084bf 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -2848,6 +2848,7 @@ setup_argstr(SV *really, SV **mark, SV **sp)
register size_t cmdlen = 0;
size_t rlen;
register SV **idx;
+ STRLEN n_a;
idx = mark;
if (really) {
@@ -2874,7 +2875,7 @@ setup_argstr(SV *really, SV **mark, SV **sp)
while (++mark <= sp) {
if (*mark) {
strcat(PL_Cmd," ");
- strcat(PL_Cmd,SvPVx(*mark,PL_na));
+ strcat(PL_Cmd,SvPVx(*mark,n_a));
}
}
return PL_Cmd;
@@ -4407,12 +4408,13 @@ rmsexpand_fromperl(CV *cv)
{
dXSARGS;
char *fspec, *defspec = NULL, *rslt;
+ STRLEN n_a;
if (!items || items > 2)
croak("Usage: VMS::Filespec::rmsexpand(spec[,defspec])");
- fspec = SvPV(ST(0),PL_na);
+ fspec = SvPV(ST(0),n_a);
if (!fspec || !*fspec) XSRETURN_UNDEF;
- if (items == 2) defspec = SvPV(ST(1),PL_na);
+ if (items == 2) defspec = SvPV(ST(1),n_a);
rslt = do_rmsexpand(fspec,NULL,1,defspec,0);
ST(0) = sv_newmortal();
@@ -4425,9 +4427,10 @@ vmsify_fromperl(CV *cv)
{
dXSARGS;
char *vmsified;
+ STRLEN n_a;
if (items != 1) croak("Usage: VMS::Filespec::vmsify(spec)");
- vmsified = do_tovmsspec(SvPV(ST(0),PL_na),NULL,1);
+ vmsified = do_tovmsspec(SvPV(ST(0),n_a),NULL,1);
ST(0) = sv_newmortal();
if (vmsified != NULL) sv_usepvn(ST(0),vmsified,strlen(vmsified));
XSRETURN(1);
@@ -4438,9 +4441,10 @@ unixify_fromperl(CV *cv)
{
dXSARGS;
char *unixified;
+ STRLEN n_a;
if (items != 1) croak("Usage: VMS::Filespec::unixify(spec)");
- unixified = do_tounixspec(SvPV(ST(0),PL_na),NULL,1);
+ unixified = do_tounixspec(SvPV(ST(0),n_a),NULL,1);
ST(0) = sv_newmortal();
if (unixified != NULL) sv_usepvn(ST(0),unixified,strlen(unixified));
XSRETURN(1);
@@ -4451,9 +4455,10 @@ fileify_fromperl(CV *cv)
{
dXSARGS;
char *fileified;
+ STRLEN n_a;
if (items != 1) croak("Usage: VMS::Filespec::fileify(spec)");
- fileified = do_fileify_dirspec(SvPV(ST(0),PL_na),NULL,1);
+ fileified = do_fileify_dirspec(SvPV(ST(0),n_a),NULL,1);
ST(0) = sv_newmortal();
if (fileified != NULL) sv_usepvn(ST(0),fileified,strlen(fileified));
XSRETURN(1);
@@ -4464,9 +4469,10 @@ pathify_fromperl(CV *cv)
{
dXSARGS;
char *pathified;
+ STRLEN n_a;
if (items != 1) croak("Usage: VMS::Filespec::pathify(spec)");
- pathified = do_pathify_dirspec(SvPV(ST(0),PL_na),NULL,1);
+ pathified = do_pathify_dirspec(SvPV(ST(0),n_a),NULL,1);
ST(0) = sv_newmortal();
if (pathified != NULL) sv_usepvn(ST(0),pathified,strlen(pathified));
XSRETURN(1);
@@ -4477,9 +4483,10 @@ vmspath_fromperl(CV *cv)
{
dXSARGS;
char *vmspath;
+ STRLEN n_a;
if (items != 1) croak("Usage: VMS::Filespec::vmspath(spec)");
- vmspath = do_tovmspath(SvPV(ST(0),PL_na),NULL,1);
+ vmspath = do_tovmspath(SvPV(ST(0),n_a),NULL,1);
ST(0) = sv_newmortal();
if (vmspath != NULL) sv_usepvn(ST(0),vmspath,strlen(vmspath));
XSRETURN(1);
@@ -4490,9 +4497,10 @@ unixpath_fromperl(CV *cv)
{
dXSARGS;
char *unixpath;
+ STRLEN n_a;
if (items != 1) croak("Usage: VMS::Filespec::unixpath(spec)");
- unixpath = do_tounixpath(SvPV(ST(0),PL_na),NULL,1);
+ unixpath = do_tounixpath(SvPV(ST(0),n_a),NULL,1);
ST(0) = sv_newmortal();
if (unixpath != NULL) sv_usepvn(ST(0),unixpath,strlen(unixpath));
XSRETURN(1);
@@ -4505,6 +4513,7 @@ candelete_fromperl(CV *cv)
char fspec[NAM$C_MAXRSS+1], *fsp;
SV *mysv;
IO *io;
+ STRLEN n_a;
if (items != 1) croak("Usage: VMS::Filespec::candelete(spec)");
@@ -4518,7 +4527,7 @@ candelete_fromperl(CV *cv)
fsp = fspec;
}
else {
- if (mysv != ST(0) || !(fsp = SvPV(mysv,PL_na)) || !*fsp) {
+ if (mysv != ST(0) || !(fsp = SvPV(mysv,n_a)) || !*fsp) {
set_errno(EINVAL); set_vaxc_errno(LIB$_INVARG);
ST(0) = &PL_sv_no;
XSRETURN(1);
@@ -4540,6 +4549,7 @@ rmscopy_fromperl(CV *cv)
unsigned long int sts;
SV *mysv;
IO *io;
+ STRLEN n_a;
if (items < 2 || items > 3)
croak("Usage: File::Copy::rmscopy(from,to[,date_flag])");
@@ -4554,7 +4564,7 @@ rmscopy_fromperl(CV *cv)
inp = inspec;
}
else {
- if (mysv != ST(0) || !(inp = SvPV(mysv,PL_na)) || !*inp) {
+ if (mysv != ST(0) || !(inp = SvPV(mysv,n_a)) || !*inp) {
set_errno(EINVAL); set_vaxc_errno(LIB$_INVARG);
ST(0) = &PL_sv_no;
XSRETURN(1);
@@ -4570,7 +4580,7 @@ rmscopy_fromperl(CV *cv)
outp = outspec;
}
else {
- if (mysv != ST(1) || !(outp = SvPV(mysv,PL_na)) || !*outp) {
+ if (mysv != ST(1) || !(outp = SvPV(mysv,n_a)) || !*outp) {
set_errno(EINVAL); set_vaxc_errno(LIB$_INVARG);
ST(0) = &PL_sv_no;
XSRETURN(1);