[ [ first ] [ ] bi ] dip exec-with-env ;
: with-fork ( child parent -- )
- [ [ fork-process dup zero? ] dip '[ drop @ ] ] dip
- if ; inline
+ [ fork-process ] 2dip if-zero ; inline
CONSTANT: SIGKILL 9
CONSTANT: SIGTERM 15
FUNCTION: pid_t wait ( int* status ) ;
FUNCTION: pid_t waitpid ( pid_t wpid, int* status, int options ) ;
-
-: wait-for-pid ( pid -- status )
- 0 <int> [ 0 waitpid drop ] keep *int WEXITSTATUS ;