From 232ce7d9f4c5bf82bedbc34b5f3d13edf3f8d344 Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Sun, 11 Nov 2007 12:11:07 -0600 Subject: [PATCH] Restored io.unix.launcher to previous state --- extra/io/unix/launcher/launcher.factor | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/extra/io/unix/launcher/launcher.factor b/extra/io/unix/launcher/launcher.factor index 61a6f706f6..45da3bf1c7 100644 --- a/extra/io/unix/launcher/launcher.factor +++ b/extra/io/unix/launcher/launcher.factor @@ -1,36 +1,13 @@ USING: io io.launcher io.unix.backend io.nonblocking sequences kernel namespaces math system alien.c-types -debugger continuations combinators.lib threads ; +debugger continuations ; IN: io.unix.launcher ! Search unix first USE: unix -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -! Factor friendly versions of the exec functions - -: >argv ( seq -- alien ) [ malloc-char-string ] map f add >c-void*-array ; - -: execv* ( pathname argv -- int ) [ malloc-char-string ] [ >argv ] bi* execv ; -: execvp* ( filename argv -- int ) [ malloc-char-string ] [ >argv ] bi* execvp ; - -: execve* ( pathname argv envp -- int ) - [ malloc-char-string ] [ >argv ] [ >argv ] tri* execve ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -! Wait for a pid to finish without freezing up all the Factor threads. -! Need to find a less kludgy way to do this. - -: wait-for-pid ( pid -- ) - dup "int" WNOHANG waitpid - 0 = [ 100 sleep wait-for-pid ] [ drop ] if ; - -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - : with-fork ( child parent -- pid ) fork [ zero? -rot if ] keep ; inline