3 exec, execl \- execute a file
11 int exec(char *name, char* argv[])
14 int execl(char *name, ...)
20 overlay the calling process with the named file, then
21 transfer to the entry point of the image of the file.
24 points to the name of the file
25 to be executed; it must not be a directory, and the permissions
26 must allow the current user to execute it
29 It should also be a valid binary image, as defined by the local
30 operating system, or a shell script
34 shell script must begin with
36 followed by the name of the program to interpret the file
37 and any initial arguments to that program, for example
44 When a C program is executed,
45 it is called as follows:
48 void main(int argc, char *argv[])
52 is a copy of the array of argument pointers passed to
54 that array must end in a null pointer, and
56 is the number of elements before the null pointer.
57 By convention, the first argument should be the name of
58 the program to be executed.
64 will be an array of the parameters that follow
66 in the call. The last argument to
68 must be a null pointer.
72 the arguments passed to the program
74 in the example above) will be the name of the file being
75 executed, any arguments on the
77 line, the name of the file again,
78 and finally the second and subsequent arguments given to the original
81 The result honors the two conventions of a program accepting as argument
82 a file to be interpreted and
87 Most attributes of the calling process are carried
88 into the result; in particular,
89 files remain open across
91 (except those opened with
94 into the open mode; see
96 and the working directory and environment
102 process has no notification handlers
106 .B \*9/src/lib9/exec.c
108 .B \*9/src/lib9/execl.c
114 If these functions fail, they return and set
116 There can be no return from a successful
120 the calling image is lost.
122 On Unix, unlike on Plan 9,
126 use the user's current path to locate
128 This is a clumsy way to deal with Unix's lack of
129 a union directory for
132 To avoid name conflicts with the underlying system,
136 are preprocessor macros defined as