From 738ab09f5846887e462080d6443fb8d1e751f247 Mon Sep 17 00:00:00 2001 From: Andy Broad Date: Sun, 13 Sep 2015 14:37:43 -0400 Subject: 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. --- pp_sys.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'pp_sys.c') 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; -- cgit v1.2.1