Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/system/Basis/Implementation/Unix/unix.sig
ViewVC logotype

Annotation of /sml/trunk/src/system/Basis/Implementation/Unix/unix.sig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 651 - (view) (download) (as text)

1 : monnier 416 (* unix.sig
2 :     *
3 :     * COPYRIGHT (c) 1995 AT&T Bell Laboratories.
4 :     *
5 :     *)
6 :    
7 :     signature UNIX =
8 :     sig
9 :     type proc
10 :    
11 :     (* executeInEnv (path, args, env)
12 :     * forks/execs new process given by path
13 :     * The new process will have environment env, and
14 :     * arguments args prepended by the last arc in path
15 :     * (following the Unix convention that the first argument
16 :     * is the command name).
17 :     * Returns an abstract type proc, which represents
18 :     * the child process plus streams attached to the
19 :     * the child process stdin/stdout.
20 :     *
21 :     * Simple command searching can be obtained by using
22 :     * executeInEnv ("/bin/sh", "-c"::args, env)
23 :     *)
24 :     val executeInEnv : string * string list * string list -> proc
25 :    
26 :     (* execute (path, args)
27 :     * = executeInEnv (path, args, Posix.ProcEnv.environ())
28 :     *)
29 :     val execute : string * string list -> proc
30 :    
31 :     (* streamsOf proc
32 :     * returns an instream and outstream used to read
33 :     * from and write to the stdout and stdin of the
34 :     * executed process.
35 :     *
36 :     * The underlying files are set to be close-on-exec.
37 :     *)
38 :     val streamsOf : proc -> TextIO.instream * TextIO.outstream
39 :    
40 :     (* reap proc
41 :     * This closes the associated streams and waits for the
42 :     * child process to finish, returns its exit status.
43 :     *
44 :     * Note that even if the child process has already exited,
45 :     * so that reap returns immediately,
46 :     * the parent process should eventually reap it. Otherwise,
47 :     * the process will remain a zombie and take a slot in the
48 :     * process table.
49 :     *)
50 :     val reap : proc -> Posix.Process.exit_status
51 :    
52 :     (* kill (proc, signal)
53 :     * sends the Posix signal to the associated process.
54 :     *)
55 :     val kill : proc * Posix.Signal.signal -> unit
56 :    
57 :     end
58 :    
59 :    

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0