diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-11-15 18:47:34 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-11-15 18:47:34 +0000 |
commit | 8d5630125a4c2a8f0b9bf3e77e79c546fb5c5a6d (patch) | |
tree | 79a2007970c37d708bda25ae6ece44fe373dfcd4 /pp_sys.c | |
parent | ce2f7c3be671853dd8e435baa8ec8d4453b3bb86 (diff) | |
download | perl-8d5630125a4c2a8f0b9bf3e77e79c546fb5c5a6d.tar.gz |
add a synchronous stub fork() for USE_ITHREADS to prove that a simple
C<if (fork()) { print "parent" } else { print "child" }> works on
Windows (incidentally running a cloned^2 interpreter :)
p4raw-id: //depot/perl@4589
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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 } |