Posix.Process
structureThe structure Posix.Process describes the primitive POSIX operations dealing with processes, as described in Section 3 of the POSIX standard [CITE]1003.1,1996/.
signature POSIX_PROCESS
structure Process
: POSIX_PROCESS
eqtype signal
eqtype pid
val wordToPid : SysWord.word -> pid
val pidToWord : pid -> SysWord.word
val fork : unit -> pid option
val exec : (string * string list) -> 'a
val exece : (string * string list * string list) -> 'a
val execp : (string * string list) -> 'a
datatype waitpid_arg = W_ANY_CHILD | W_CHILD of pid | W_SAME_GROUP | W_GROUP of pid
datatype exit_status = W_EXITED | W_EXITSTATUS of Word8.word | W_SIGNALED of signal | W_STOPPED of signal
structure W : sig
include POSIX_FLAGS
val untraced : flags
end
val wait : unit -> (pid * exit_status)
val waitpid : (waitpid_arg * W.flags list) -> (pid * exit_status)
val waitpid_nh : (waitpid_arg * W.flags list) -> (pid * exit_status) option
val exit : Word8.word -> 'a
datatype killpid_arg = K_PROC of pid | K_SAME_GROUP | K_GROUP of pid
val kill : (killpid_arg * signal) -> unit
val alarm : Time.time -> Time.time
val pause : unit -> unit
val sleep : Time.time -> Time.time
eqtype signal
eqtype pid
wordToPid i
pidToWord pi
fork ()
exec (path, args)
exece (path, args, env)
execp (file, args)
Normally, the new image is given the same environment as the calling program. The env argument in exece allows the program to specify a new environment.
The args argument is a list of string arguments to be passed to the new program. By convention, the first item in args is some form of the file name of the new program, usually the last arc in the path or file name.
datatype waitpid_arg
W_ANY_CHILD
W_CHILD of pid
W_SAME_GROUP
W_GROUP of pid
datatype exit_status
W_EXITED
W_EXITSTATUS of Word8.word
W_SIGNALED of signal
W_STOPPED of signal
structure W
untraced
wait ()
waitpid (wa, l)
waitpid_nh (wa, l)
exit i
Calling exit does not flush or close any open IO streams, nor does it call OS.Process.atExit. It does close any open POSIX files, and performs the actions associated with the C version of exit.
datatype killpid_arg
K_PROC of pid
K_SAME_GROUP
K_GROUP of pid
kill (ka, si)
alarm ti
pause ()
sleep ti
POSIX_FLAGS, Posix, Posix.Signal, OS
Last Modified April 18, 1996
Comments to John Reppy.
Copyright © 1997 Bell Labs, Lucent Technologies