summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorAndy Broad <andy@broad.ology.org.uk>2015-09-13 14:37:43 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2015-09-16 07:44:29 -0400
commit738ab09f5846887e462080d6443fb8d1e751f247 (patch)
tree28815d963b6369d436789f18cf4551d662b3e171 /pp_sys.c
parentdee43f802e849f37f65552e91b5dda77197dc05b (diff)
downloadperl-738ab09f5846887e462080d6443fb8d1e751f247.tar.gz
amigaos4: move the amigaos exec code under amigaos4
Largely reimplements 839a9f02, 54fa14d7, e8432c63, 40262ff4. The upside is that now doio.c and pp_sys.c have much less AmigaOS specific ifdefs. As a downside, the exec code is now forked (pun only partially accidental.) The earlier story regarding fork+exec, that the AmigaOS creating thread doesn't terminate but instead continues running is both true and false. The more detailed story is that the user-observable behaviour is as with POSIX/UNIX. The thread that created the new "task" (to use the AmigaOS terms) does hang around -- but all it does is to wait for the new task to terminate, and more importantly, it holds on to the resources like filehandles. If the task were to immediately terminate, the resources would be reclaimed by the kernel.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/pp_sys.c b/pp_sys.c
index c8c84b3754..8ce03bb30f 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -4488,9 +4488,6 @@ PP(pp_exec)
{
dSP; dMARK; dORIGMARK; dTARGET;
I32 value;
-#if defined(__amigaos4__)
- StdioStore store;
-#endif
if (TAINTING_get) {
TAINT_ENV();
@@ -4502,12 +4499,7 @@ PP(pp_exec)
MARK = ORIGMARK;
TAINT_PROPER("exec");
}
-#if defined(__amigaos4__)
- /* Make sure redirection behaves after exec. Yes, in AmigaOS the
- * original process continues after exec, since processes are more
- * like threads. */
- amigaos_stdio_save(aTHX_ &store);
-#endif
+
PERL_FLUSHALL_FOR_CHILD;
if (PL_op->op_flags & OPf_STACKED) {
SV * const really = *++MARK;
@@ -4526,13 +4518,6 @@ PP(pp_exec)
value = (I32)do_exec(SvPVx_nolen(sv_mortalcopy(*SP)));
#endif
}
-
-#if defined(__amigaos4__)
- amigaos_stdio_restore(aTHX_ &store);
- STATUS_NATIVE_CHILD_SET(value);
- PL_exit_flags |= PERL_EXIT_EXPECTED;
- if (value != -1) my_exit(value);
-#endif
SP = ORIGMARK;
XPUSHi(value);
RETURN;