#else
#endif
#if defined(USE_ITHREADS)
+# if defined(USE_IMPLICIT_SYS)
+# endif
#endif
#if defined(MYMALLOC)
#define malloced_size Perl_malloced_size
#else
#endif
#if defined(USE_ITHREADS)
+# if defined(USE_IMPLICIT_SYS)
+# endif
#endif
#if defined(MYMALLOC)
#define malloced_size Perl_malloced_size
#else
#endif
#if defined(USE_ITHREADS)
+# if defined(USE_IMPLICIT_SYS)
+# endif
#endif
#if defined(MYMALLOC)
#define malloc Perl_malloc
|int argc|char** argv|char** env
#if defined(USE_ITHREADS)
jno |PerlInterpreter*|perl_clone|PerlInterpreter* interp, UV flags
+# if defined(USE_IMPLICIT_SYS)
jno |PerlInterpreter*|perl_clone_using|PerlInterpreter *interp|UV flags \
|struct IPerlMem* m|struct IPerlMem* ms \
|struct IPerlMem* mp|struct IPerlEnv* e \
|struct IPerlStdIO* io|struct IPerlLIO* lio \
|struct IPerlDir* d|struct IPerlSock* s \
|struct IPerlProc* p
+# endif
#endif
#if defined(MYMALLOC)
#include "perlsdio.h"
#include "perl.h"
+#define PerlIO_fdupopen(f) (f)
#endif /* PERL_IMPLICIT_SYS */
unless ($define{'PERL_IMPLICIT_SYS'}) {
skip_symbols [qw(
perl_alloc_using
+ perl_clone_using
)];
}
# extra globals not included above.
perl_alloc
perl_alloc_using
+perl_clone
+perl_clone_using
perl_construct
perl_destruct
perl_free
#else
#endif
#if defined(USE_ITHREADS)
+# if defined(USE_IMPLICIT_SYS)
+# endif
#endif
#if defined(MYMALLOC)
#endif
#else
#endif
#if defined(USE_ITHREADS)
+# if defined(USE_IMPLICIT_SYS)
+# endif
#endif
#if defined(MYMALLOC)
#endif
tend = uv_to_utf8(tmpbuf, uv);
- if (!SvPADTMP(sv) || tend - tmpbuf != ulen) {
+ if (!SvPADTMP(sv) || tend - tmpbuf != ulen || SvREADONLY(sv)) {
dTARGET;
sv_setpvn(TARG, (char*)tmpbuf, tend - tmpbuf);
sv_catpvn(TARG, (char*)(s + ulen), slen - ulen);
}
}
else {
- if (!SvPADTMP(sv)) {
+ if (!SvPADTMP(sv) || SvREADONLY(sv)) {
dTARGET;
sv_setsv(TARG, sv);
sv = TARG;
tend = uv_to_utf8(tmpbuf, uv);
- if (!SvPADTMP(sv) || tend - tmpbuf != ulen) {
+ if (!SvPADTMP(sv) || tend - tmpbuf != ulen || SvREADONLY(sv)) {
dTARGET;
sv_setpvn(TARG, (char*)tmpbuf, tend - tmpbuf);
sv_catpvn(TARG, (char*)(s + ulen), slen - ulen);
}
}
else {
- if (!SvPADTMP(sv)) {
+ if (!SvPADTMP(sv) || SvREADONLY(sv)) {
dTARGET;
sv_setsv(TARG, sv);
sv = TARG;
}
}
else {
- if (!SvPADTMP(sv)) {
+ if (!SvPADTMP(sv) || SvREADONLY(sv)) {
dTARGET;
sv_setsv(TARG, sv);
sv = TARG;
}
}
else {
- if (!SvPADTMP(sv)) {
+ if (!SvPADTMP(sv) || SvREADONLY(sv)) {
dTARGET;
sv_setsv(TARG, sv);
sv = TARG;
* of pack() (and all copies of the result) are
* gone.
*/
- if (ckWARN(WARN_UNSAFE) && (SvTEMP(fromstr) || SvPADTMP(fromstr)))
+ if (ckWARN(WARN_UNSAFE) && (SvTEMP(fromstr)
+ || (SvPADTMP(fromstr)
+ && !SvREADONLY(fromstr))))
+ {
Perl_warner(aTHX_ WARN_UNSAFE,
"Attempt to pack pointer to temporary value");
+ }
if (SvPOK(fromstr) || SvNIOK(fromstr))
aptr = SvPV(fromstr,n_a);
else
PUSHi(childpid);
RETURN;
#else
-# if defined(USE_ITHREADS) && defined(WIN32)
+# if defined(USE_ITHREADS) && defined(USE_IMPLICIT_SYS)
djSP; dTARGET;
Pid_t childpid;
#endif
}
-#ifdef USE_ITHREADS
+#if !defined(HAS_FORK) && defined(USE_ITHREADS) && defined(USE_IMPLICIT_SYS)
if (value >= 0)
my_exit(value);
#endif
PERL_CALLCONV int perl_parse(PerlInterpreter* interp, XSINIT_t xsinit, int argc, char** argv, char** env);
#if defined(USE_ITHREADS)
PERL_CALLCONV PerlInterpreter* perl_clone(PerlInterpreter* interp, UV flags);
+# if defined(USE_IMPLICIT_SYS)
PERL_CALLCONV PerlInterpreter* perl_clone_using(PerlInterpreter *interp, UV flags, struct IPerlMem* m, struct IPerlMem* ms, struct IPerlMem* mp, struct IPerlEnv* e, struct IPerlStdIO* io, struct IPerlLIO* lio, struct IPerlDir* d, struct IPerlSock* s, struct IPerlProc* p);
+# endif
#endif
#if defined(MYMALLOC)
#endif
PerlInterpreter *
-perl_clone(PerlInterpreter *my_perl, UV flags)
+perl_clone(PerlInterpreter *proto_perl, UV flags)
{
#ifdef PERL_OBJECT
- CPerlObj *pPerl = (CPerlObj*)my_perl;
+ CPerlObj *pPerl = (CPerlObj*)proto_perl;
#endif
- return perl_clone_using(my_perl, flags, PL_Mem, PL_MemShared, PL_MemParse,
- PL_Env, PL_StdIO, PL_LIO, PL_Dir, PL_Sock, PL_Proc);
+
+#ifdef PERL_IMPLICIT_SYS
+ return perl_clone_using(proto_perl, flags,
+ proto_perl->IMem,
+ proto_perl->IMemShared,
+ proto_perl->IMemParse,
+ proto_perl->IEnv,
+ proto_perl->IStdIO,
+ proto_perl->ILIO,
+ proto_perl->IDir,
+ proto_perl->ISock,
+ proto_perl->IProc);
}
PerlInterpreter *
IV i;
SV *sv;
SV **svp;
-#ifdef PERL_OBJECT
+# ifdef PERL_OBJECT
CPerlObj *pPerl = new(ipM) CPerlObj(ipM, ipMS, ipMP, ipE, ipStd, ipLIO,
ipD, ipS, ipP);
PERL_SET_INTERP(pPerl);
-#else
+# else /* !PERL_OBJECT */
PerlInterpreter *my_perl = (PerlInterpreter*)(*ipM->pMalloc)(ipM, sizeof(PerlInterpreter));
PERL_SET_INTERP(my_perl);
-# ifdef DEBUGGING
+# ifdef DEBUGGING
memset(my_perl, 0xab, sizeof(PerlInterpreter));
PL_markstack = 0;
PL_scopestack = 0;
PL_savestack = 0;
PL_retstack = 0;
-# else
+# else /* !DEBUGGING */
Zero(my_perl, 1, PerlInterpreter);
-# endif
+# endif /* DEBUGGING */
/* host pointers */
PL_Mem = ipM;
PL_Dir = ipD;
PL_Sock = ipS;
PL_Proc = ipP;
-#endif
+# endif /* PERL_OBJECT */
+#else /* !PERL_IMPLICIT_SYS */
+ IV i;
+ SV *sv;
+ SV **svp;
+ PerlInterpreter *my_perl = (PerlInterpreter*)PerlMem_malloc(sizeof(PerlInterpreter));
+#endif /* PERL_IMPLICIT_SYS */
/* arena roots */
PL_xiv_arenaroot = NULL;