summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/pp_sys.c b/pp_sys.c
index b2495a06dc..ebc5e2776c 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3582,7 +3582,22 @@ PP(pp_fork)
PUSHi(childpid);
RETURN;
#else
+# ifdef USE_ITHREADS
+ /* XXXXXX testing */
+ djSP; dTARGET;
+ /* XXX this just an approximation of what will eventually be run
+ * in a different thread */
+ PerlInterpreter *new_perl = perl_clone(my_perl, 0);
+ Perl_pp_enter(new_perl);
+ new_perl->Top = new_perl->Top->op_next; /* continue from next op */
+ CALLRUNOPS(new_perl);
+
+ /* parent returns with negative pseudo-pid */
+ PUSHi(-1);
+ RETURN;
+# else
DIE(aTHX_ PL_no_func, "Unsupported function fork");
+# endif
#endif
}