3 * Copyright (c) 1991-1994, Larry Wall
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
11 * "Sam sat on the ground and put his head in his hands. 'I wish I had never
12 * come here, and I don't want to see no more magic,' he said, and fell silent."
18 /* Omit -- it causes too much grief on mixed systems.
25 * Use the "DESTRUCTOR" scope cleanup to reinstate magic.
32 typedef struct magic_state MGS;
34 static void restore_magic _((void *p));
42 assert(SvMAGICAL(sv));
44 mgs = (MGS*)safemalloc(sizeof(MGS));
46 mgs->mgs_flags = SvMAGICAL(sv) | SvREADONLY(sv);
47 SAVEDESTRUCTOR(restore_magic, mgs);
51 SvFLAGS(sv) |= (SvFLAGS(sv) & (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT;
63 if (SvTYPE(sv) >= SVt_PVMG && SvMAGIC(sv))
66 SvFLAGS(sv) |= mgs->mgs_flags;
70 SvFLAGS(sv) &= ~(SVf_IOK|SVf_NOK|SVf_POK);
82 for (mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) {
83 MGVTBL* vtbl = mg->mg_virtual;
85 if (vtbl->svt_get && !(mg->mg_flags & MGf_GSKIP))
89 if (!(SvFLAGS(sv) & (SVs_GMG|SVs_SMG)) || vtbl->svt_clear)
104 mgs = save_magic(sv);
107 while ((mg = *mgp) != 0) {
108 MGVTBL* vtbl = mg->mg_virtual;
109 if (!(mg->mg_flags & MGf_GSKIP) && vtbl && vtbl->svt_get) {
110 (*vtbl->svt_get)(sv, mg);
111 /* Ignore this magic if it's been deleted */
112 if (*mgp == mg && (mg->mg_flags & MGf_GSKIP))
115 /* Advance to next magic (complicated by possible deletion) */
117 mgp = &mg->mg_moremagic;
133 mgs = save_magic(sv);
135 for (mg = SvMAGIC(sv); mg; mg = nextmg) {
136 MGVTBL* vtbl = mg->mg_virtual;
137 nextmg = mg->mg_moremagic; /* it may delete itself */
138 if (mg->mg_flags & MGf_GSKIP) {
139 mg->mg_flags &= ~MGf_GSKIP; /* setting requires another read */
142 if (vtbl && vtbl->svt_set)
143 (*vtbl->svt_set)(sv, mg);
158 for (mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) {
159 MGVTBL* vtbl = mg->mg_virtual;
160 if (vtbl && vtbl->svt_len) {
163 /* omit MGf_GSKIP -- not changed here */
164 len = (*vtbl->svt_len)(sv, mg);
170 junk = SvPV(sv, len);
183 for (mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) {
184 MGVTBL* vtbl = mg->mg_virtual;
185 /* omit GSKIP -- never set here */
187 if (vtbl && vtbl->svt_clear)
188 (*vtbl->svt_clear)(sv, mg);
201 for (mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) {
202 if (mg->mg_type == type)
209 mg_copy(sv, nsv, key, klen)
217 for (mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) {
218 if (isUPPER(mg->mg_type)) {
219 sv_magic(nsv, mg->mg_obj, toLOWER(mg->mg_type), key, klen);
232 for (mg = SvMAGIC(sv); mg; mg = moremagic) {
233 MGVTBL* vtbl = mg->mg_virtual;
234 moremagic = mg->mg_moremagic;
235 if (vtbl && vtbl->svt_free)
236 (*vtbl->svt_free)(sv, mg);
237 if (mg->mg_ptr && mg->mg_type != 'g')
238 Safefree(mg->mg_ptr);
239 if (mg->mg_flags & MGf_REFCOUNTED)
240 SvREFCNT_dec(mg->mg_obj);
247 #if !defined(NSIG) || defined(M_UNIX) || defined(M_XENIX)
261 switch (*mg->mg_ptr) {
262 case '1': case '2': case '3': case '4':
263 case '5': case '6': case '7': case '8': case '9': case '&':
265 paren = atoi(mg->mg_ptr);
267 if (curpm->op_pmregexp &&
268 paren <= curpm->op_pmregexp->nparens &&
269 (s = curpm->op_pmregexp->startp[paren]) &&
270 (t = curpm->op_pmregexp->endp[paren]) ) {
280 paren = curpm->op_pmregexp->lastparen;
289 if (curpm->op_pmregexp &&
290 (s = curpm->op_pmregexp->subbeg) ) {
291 i = curpm->op_pmregexp->startp[0] - s;
299 if (curpm->op_pmregexp &&
300 (s = curpm->op_pmregexp->endp[0]) ) {
301 return (STRLEN) (curpm->op_pmregexp->subend - s);
306 return (STRLEN)ofslen;
308 return (STRLEN)orslen;
311 if (!SvPOK(sv) && SvNIOK(sv))
328 switch (*mg->mg_ptr) {
329 case '\001': /* ^A */
330 sv_setsv(sv, bodytarget);
332 case '\004': /* ^D */
333 sv_setiv(sv,(I32)(debug & 32767));
335 case '\005': /* ^E */
338 # include <descrip.h>
339 # include <starlet.h>
341 $DESCRIPTOR(msgdsc,msg);
342 sv_setnv(sv,(double)vaxc$errno);
343 if (sys$getmsg(vaxc$errno,&msgdsc.dsc$w_length,&msgdsc,0,0) & 1)
344 sv_setpvn(sv,msgdsc.dsc$a_pointer,msgdsc.dsc$w_length);
349 sv_setnv(sv,(double)errno);
350 sv_setpv(sv, errno ? Strerror(errno) : "");
352 SvNOK_on(sv); /* what a wonderful hack! */
354 case '\006': /* ^F */
355 sv_setiv(sv,(I32)maxsysfd);
357 case '\010': /* ^H */
358 sv_setiv(sv,(I32)hints);
362 sv_setpv(sv, inplace);
364 sv_setsv(sv,&sv_undef);
366 case '\017': /* ^O */
369 case '\020': /* ^P */
370 sv_setiv(sv,(I32)perldb);
372 case '\024': /* ^T */
373 sv_setiv(sv,(I32)basetime);
375 case '\027': /* ^W */
376 sv_setiv(sv,(I32)dowarn);
378 case '1': case '2': case '3': case '4':
379 case '5': case '6': case '7': case '8': case '9': case '&':
381 paren = atoi(GvENAME(mg->mg_obj));
383 if (curpm->op_pmregexp &&
384 paren <= curpm->op_pmregexp->nparens &&
385 (s = curpm->op_pmregexp->startp[paren]) &&
386 (t = curpm->op_pmregexp->endp[paren]) ) {
391 if (tainting && (tmg = mg_find(sv,'t')))
392 tmg->mg_len = 0; /* guarantee $1 untainted */
397 sv_setsv(sv,&sv_undef);
401 paren = curpm->op_pmregexp->lastparen;
405 sv_setsv(sv,&sv_undef);
409 if (curpm->op_pmregexp &&
410 (s = curpm->op_pmregexp->subbeg) ) {
411 i = curpm->op_pmregexp->startp[0] - s;
418 sv_setsv(sv,&sv_undef);
422 if (curpm->op_pmregexp &&
423 (s = curpm->op_pmregexp->endp[0]) ) {
424 sv_setpvn(sv,s, curpm->op_pmregexp->subend - s);
428 sv_setsv(sv,&sv_undef);
432 if (GvIO(last_in_gv)) {
433 sv_setiv(sv,(I32)IoLINES(GvIO(last_in_gv)));
438 sv_setiv(sv,(I32)statusvalue);
441 s = IoTOP_NAME(GvIOp(defoutgv));
445 sv_setpv(sv,GvENAME(defoutgv));
450 s = IoFMT_NAME(GvIOp(defoutgv));
452 s = GvENAME(defoutgv);
457 sv_setiv(sv,(I32)IoPAGE_LEN(GvIOp(defoutgv)));
460 sv_setiv(sv,(I32)IoLINES_LEFT(GvIOp(defoutgv)));
463 sv_setiv(sv,(I32)IoPAGE(GvIOp(defoutgv)));
471 sv_setiv(sv,(I32)curcop->cop_arybase);
474 sv_setiv(sv, (IoFLAGS(GvIOp(defoutgv)) & IOf_FLUSH) != 0 );
477 sv_setpvn(sv,ofs,ofslen);
480 sv_setpvn(sv,ors,orslen);
487 sv_setnv(sv,(double)((errno == EVMSERR) ? vaxc$errno : errno));
489 sv_setnv(sv,(double)errno);
491 sv_setpv(sv, errno ? Strerror(errno) : "");
492 SvNOK_on(sv); /* what a wonderful hack! */
495 sv_setiv(sv,(I32)uid);
498 sv_setiv(sv,(I32)euid);
502 (void)sprintf(s,"%d",(int)gid);
506 (void)sprintf(s,"%d",(int)egid);
514 Groups_t gary[NGROUPS];
516 i = getgroups(NGROUPS,gary);
518 (void)sprintf(s," %ld", (long)gary[i]);
534 magic_getuvar(sv, mg)
538 struct ufuncs *uf = (struct ufuncs *)mg->mg_ptr;
540 if (uf && uf->uf_val)
541 (*uf->uf_val)(uf->uf_index, sv);
554 my_setenv(mg->mg_ptr,s);
555 #ifdef DYNAMIC_ENV_FETCH
556 /* We just undefd an environment var. Is a replacement */
557 /* waiting in the wings? */
560 if (envsvp = hv_fetch(GvHVn(envgv),mg->mg_ptr,mg->mg_len,FALSE))
561 s = SvPV(*envsvp,len);
564 /* And you'll never guess what the dog had */
565 /* in its mouth... */
567 if (s && strEQ(mg->mg_ptr,"PATH")) {
568 char *strend = s + len;
571 s = cpytill(tokenbuf,s,strend,':',&i);
574 || (Stat(tokenbuf,&statbuf) && (statbuf.st_mode & 2)) )
583 magic_clearenv(sv,mg)
587 my_setenv(mg->mg_ptr,Nullch);
592 /* set up reliable signal() clone */
594 typedef void (*Sigfunc) _((int));
597 Sigfunc rsignal(signo,handler)
601 struct sigaction act,oact;
603 act.sa_handler = handler;
604 sigemptyset(&act.sa_mask);
607 if (signo == SIGALRM) {
612 act.sa_flags |= SA_INTERRUPT; /* SunOS */
616 act.sa_flags |= SA_RESTART; /* SVR4, 4.3+BSD */
619 if (sigaction(signo, &act, &oact) < 0)
622 return(oact.sa_handler);
627 /* ah well, so much for reliability */
629 #define rsignal(x,y) signal(x,y)
645 if (strEQ(s,"__DIE__"))
647 else if (strEQ(s,"__WARN__"))
649 else if (strEQ(s,"__PARSE__"))
652 croak("No such hook: %s", s);
660 i = whichsig(s); /* ...no, a brick */
662 if (dowarn || strEQ(s,"ALARM"))
663 warn("No such signal: SIG%s", s);
667 if (SvTYPE(sv) == SVt_PVGV || SvROK(sv)) {
669 (void)rsignal(i,sighandler);
671 *svp = SvREFCNT_inc(sv);
674 s = SvPV_force(sv,na);
675 if (strEQ(s,"IGNORE")) {
677 (void)rsignal(i,SIG_IGN);
681 else if (strEQ(s,"DEFAULT") || !*s) {
683 (void)rsignal(i,SIG_DFL);
688 if (!strchr(s,':') && !strchr(s,'\'')) {
689 sprintf(tokenbuf, "main::%s",s);
690 sv_setpv(sv,tokenbuf);
693 (void)rsignal(i,sighandler);
695 *svp = SvREFCNT_inc(sv);
712 magic_setamagic(sv,mg)
716 /* HV_badAMAGIC_on(Sv_STASH(sv)); */
721 #endif /* OVERLOAD */
724 magic_methpack(sv,mg,meth)
737 PUSHs(sv_2mortal(newSVpv(mg->mg_ptr, mg->mg_len)));
738 else if (mg->mg_type == 'p')
739 PUSHs(sv_2mortal(newSViv(mg->mg_len)));
742 if (perl_call_method(meth, G_SCALAR))
743 sv_setsv(sv, *stack_sp--);
755 magic_methpack(sv,mg,"FETCH");
757 mg->mg_flags |= MGf_GSKIP;
772 PUSHs(sv_2mortal(newSVpv(mg->mg_ptr, mg->mg_len)));
773 else if (mg->mg_type == 'p')
774 PUSHs(sv_2mortal(newSViv(mg->mg_len)));
778 perl_call_method("STORE", G_SCALAR|G_DISCARD);
784 magic_clearpack(sv,mg)
788 return magic_methpack(sv,mg,"DELETE");
791 int magic_wipepack(sv,mg)
801 perl_call_method("CLEAR", G_SCALAR|G_DISCARD);
807 magic_nextpack(sv,mg,key)
813 char *meth = SvOK(key) ? "NEXTKEY" : "FIRSTKEY";
824 if (perl_call_method(meth, G_SCALAR))
825 sv_setsv(key, *stack_sp--);
833 magic_existspack(sv,mg)
837 return magic_methpack(sv,mg,"EXISTS");
841 magic_setdbline(sv,mg)
852 svp = av_fetch(GvAV(gv),atoi(mg->mg_ptr), FALSE);
853 if (svp && SvIOKp(*svp) && (o = (OP*)SvSTASH(*svp)))
856 warn("Can't break at that line\n");
861 magic_getarylen(sv,mg)
865 sv_setiv(sv, AvFILL((AV*)mg->mg_obj) + curcop->cop_arybase);
870 magic_setarylen(sv,mg)
874 av_fill((AV*)mg->mg_obj, SvIV(sv) - curcop->cop_arybase);
883 SV* lsv = LvTARG(sv);
885 if (SvTYPE(lsv) >= SVt_PVMG && SvMAGIC(lsv)) {
886 mg = mg_find(lsv, 'g');
887 if (mg && mg->mg_len >= 0) {
888 sv_setiv(sv, mg->mg_len + curcop->cop_arybase);
901 SV* lsv = LvTARG(sv);
907 if (SvTYPE(lsv) >= SVt_PVMG && SvMAGIC(lsv))
908 mg = mg_find(lsv, 'g');
912 sv_magic(lsv, (SV*)0, 'g', Nullch, 0);
913 mg = mg_find(lsv, 'g');
915 else if (!SvOK(sv)) {
919 len = SvPOK(lsv) ? SvCUR(lsv) : sv_len(lsv);
921 pos = SvIV(sv) - curcop->cop_arybase;
939 gv_efullname(sv,((GV*)sv));/* a gv value, be nice */
954 if (*s == '*' && s[1])
956 gv = gv_fetchpv(s,TRUE, SVt_PVGV);
961 GvGP(sv) = gp_ref(GvGP(gv));
972 magic_setsubstr(sv,mg)
977 char *tmps = SvPV(sv,len);
978 sv_insert(LvTARG(sv),LvTARGOFF(sv),LvTARGLEN(sv), tmps, len);
983 magic_gettaint(sv,mg)
989 else if (mg->mg_len & 2 && mg->mg_obj == sv) /* kludge */
995 magic_settaint(sv,mg)
1000 if (localizing == 1)
1017 do_vecset(sv); /* XXX slurp this routine */
1022 magic_setmglob(sv,mg)
1036 sv_unmagic(sv, 'B');
1042 magic_setuvar(sv,mg)
1046 struct ufuncs *uf = (struct ufuncs *)mg->mg_ptr;
1048 if (uf && uf->uf_set)
1049 (*uf->uf_set)(uf->uf_index, sv);
1061 switch (*mg->mg_ptr) {
1062 case '\001': /* ^A */
1063 sv_setsv(bodytarget, sv);
1065 case '\004': /* ^D */
1066 debug = (SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv)) | 0x80000000;
1067 DEBUG_x(dump_all());
1069 case '\005': /* ^E */
1071 set_vaxc_errno(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
1073 SETERRNO(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv),4); /* will anyone ever use this? */
1076 case '\006': /* ^F */
1077 maxsysfd = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv);
1079 case '\010': /* ^H */
1080 hints = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv);
1086 inplace = savepv(SvPV(sv,na));
1090 case '\017': /* ^O */
1094 osname = savepv(SvPV(sv,na));
1098 case '\020': /* ^P */
1099 i = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv);
1108 case '\024': /* ^T */
1109 basetime = (Time_t)(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
1111 case '\027': /* ^W */
1112 dowarn = (bool)(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
1116 if (localizing == 1)
1117 save_sptr((SV**)&last_in_gv);
1120 IoLINES(GvIOp(last_in_gv)) = (long)SvIV(sv);
1123 Safefree(IoTOP_NAME(GvIOp(defoutgv)));
1124 IoTOP_NAME(GvIOp(defoutgv)) = s = savepv(SvPV(sv,na));
1125 IoTOP_GV(GvIOp(defoutgv)) = gv_fetchpv(s,TRUE, SVt_PVIO);
1128 Safefree(IoFMT_NAME(GvIOp(defoutgv)));
1129 IoFMT_NAME(GvIOp(defoutgv)) = s = savepv(SvPV(sv,na));
1130 IoFMT_GV(GvIOp(defoutgv)) = gv_fetchpv(s,TRUE, SVt_PVIO);
1133 IoPAGE_LEN(GvIOp(defoutgv)) = (long)(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
1136 IoLINES_LEFT(GvIOp(defoutgv)) = (long)(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
1137 if (IoLINES_LEFT(GvIOp(defoutgv)) < 0L)
1138 IoLINES_LEFT(GvIOp(defoutgv)) = 0L;
1141 IoPAGE(GvIOp(defoutgv)) = (long)(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
1144 IoFLAGS(GvIOp(defoutgv)) &= ~IOf_FLUSH;
1145 if ((SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv)) != 0) {
1146 IoFLAGS(GvIOp(defoutgv)) |= IOf_FLUSH;
1150 i = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv);
1151 multiline = (i != 0);
1157 rs = SvREFCNT_inc(nrs);
1162 ors = savepv(SvPV(sv,orslen));
1167 ofs = savepv(SvPV(sv, ofslen));
1172 ofmt = savepv(SvPV(sv,na));
1175 compiling.cop_arybase = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv);
1178 statusvalue = FIXSTATUS(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
1181 SETERRNO(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv),SvIV(sv) == EVMSERR ? 4 : vaxc$errno); /* will anyone ever use this? */
1184 uid = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv);
1186 delaymagic |= DM_RUID;
1187 break; /* don't do magic till later */
1190 (void)setruid((Uid_t)uid);
1193 (void)setreuid((Uid_t)uid, (Uid_t)-1);
1195 #ifdef HAS_SETRESUID
1196 (void)setresuid((Uid_t)uid, (Uid_t)-1, (Uid_t)-1);
1198 if (uid == euid) /* special case $< = $> */
1201 uid = (I32)getuid();
1202 croak("setruid() not implemented");
1207 uid = (I32)getuid();
1208 tainting |= (uid && (euid != uid || egid != gid));
1211 euid = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv);
1213 delaymagic |= DM_EUID;
1214 break; /* don't do magic till later */
1217 (void)seteuid((Uid_t)euid);
1220 (void)setreuid((Uid_t)-1, (Uid_t)euid);
1222 #ifdef HAS_SETRESUID
1223 (void)setresuid((Uid_t)-1, (Uid_t)euid, (Uid_t)-1);
1225 if (euid == uid) /* special case $> = $< */
1228 euid = (I32)geteuid();
1229 croak("seteuid() not implemented");
1234 euid = (I32)geteuid();
1235 tainting |= (uid && (euid != uid || egid != gid));
1238 gid = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv);
1240 delaymagic |= DM_RGID;
1241 break; /* don't do magic till later */
1244 (void)setrgid((Gid_t)gid);
1247 (void)setregid((Gid_t)gid, (Gid_t)-1);
1249 #ifdef HAS_SETRESGID
1250 (void)setresgid((Gid_t)gid, (Gid_t)-1, (Gid_t) 1);
1252 if (gid == egid) /* special case $( = $) */
1255 gid = (I32)getgid();
1256 croak("setrgid() not implemented");
1261 gid = (I32)getgid();
1262 tainting |= (uid && (euid != uid || egid != gid));
1265 egid = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv);
1267 delaymagic |= DM_EGID;
1268 break; /* don't do magic till later */
1271 (void)setegid((Gid_t)egid);
1274 (void)setregid((Gid_t)-1, (Gid_t)egid);
1276 #ifdef HAS_SETRESGID
1277 (void)setresgid((Gid_t)-1, (Gid_t)egid, (Gid_t)-1);
1279 if (egid == gid) /* special case $) = $( */
1282 egid = (I32)getegid();
1283 croak("setegid() not implemented");
1288 egid = (I32)getegid();
1289 tainting |= (uid && (euid != uid || egid != gid));
1292 chopset = SvPV_force(sv,na);
1298 /* See if all the arguments are contiguous in memory */
1299 for (i = 1; i < origargc; i++) {
1300 if (origargv[i] == s + 1)
1301 s += strlen(++s); /* this one is ok too */
1303 if (origenviron[0] == s + 1) { /* can grab env area too? */
1304 my_setenv("NoNeSuCh", Nullch);
1305 /* force copy of environment */
1306 for (i = 0; origenviron[i]; i++)
1307 if (origenviron[i] == s + 1)
1310 origalen = s - origargv[0];
1312 s = SvPV_force(sv,len);
1314 if (i >= origalen) {
1318 Copy(s, origargv[0], i, char);
1321 Copy(s, origargv[0], i, char);
1324 while (++i < origalen)
1327 for (i = 1; i < origargc; i++)
1328 origargv[i] = Nullch;
1339 register char **sigv;
1341 for (sigv = sig_name+1; *sigv; sigv++)
1342 if (strEQ(sig,*sigv))
1343 return sig_num[sigv - sig_name];
1345 if (strEQ(sig,"CHLD"))
1349 if (strEQ(sig,"CLD"))
1367 #ifdef OS2 /* or anybody else who requires SIG_ACK */
1368 signal(sig, SIG_ACK);
1371 signame = sig_name[sig];
1372 cv = sv_2cv(*hv_fetch(GvHVn(siggv),signame,strlen(signame),
1375 if (!cv || !CvROOT(cv) &&
1376 *signame == 'C' && instr(signame,"LD")) {
1378 if (signame[1] == 'H')
1379 cv = sv_2cv(*hv_fetch(GvHVn(siggv),"CLD",3,TRUE),
1382 cv = sv_2cv(*hv_fetch(GvHVn(siggv),"CHLD",4,TRUE),
1386 if (!cv || !CvROOT(cv)) {
1388 warn("SIG%s handler \"%s\" not defined.\n",
1389 signame, GvENAME(gv) );
1394 if (stack != signalstack)
1395 AvFILL(signalstack) = 0;
1396 SWITCHSTACK(stack, signalstack);
1398 sv = sv_newmortal();
1399 sv_setpv(sv,signame);
1404 perl_call_sv((SV*)cv, G_DISCARD);
1406 SWITCHSTACK(signalstack, oldstack);