Syntax | #include <unistd.h> int execl (const char *path, const char *arg0, ... , (char *)0 ); |
Syntax | #include <unistd.h> int execl (const char *path, const char *arg0, ... , (char *)0 ); | |
Description | The The new image is constructed from a regular, executable file (path or file) called the new process image file. There is no return from a successful When a C program is executed as a result of a call to an
where argc is the argument count and argv is an array of character pointers to the arguments themselves. argc is at least 1, and the first element of the array points to a string containing the name of the executable file. In addition, the following variable is initialized as the address of an array of
argv and The arguments specified by a program with one of the exec functions are passed on to the new process image in the corresponding path points to a pathname that identifies the new process image file. file is used to construct a pathname that identifies the new process image file. If file contains a slash character, then the file argument is used as the pathname for the process image file. Otherwise, the path prefix for this file is obtained by a search of the directories defined by the environment variable If the process image file is not a valid executable object, arg0, ... are pointers to null-terminated character strings. These strings constitute the argument list available to the new process image. The list is terminated by a null pointer. The argument arg0 should point to a filename that is associated with the process being started by one of the argv is an array of character pointers to null-terminated strings. The last element in this array must be a null pointer. These strings constitute the argument list for the new process image. The value in argv[0] should point to a filename that is associated with the process being started by one of the envp is an array of character pointers to null-terminated strings. These strings constitute the environment for the new process image. The envp array is terminated by a null pointer. In the case of functions which do not pass envp as an argument ( The number of bytes available for the combined argument and environment lists of the process is File descriptors open in the calling process image remain open in the new process image, except for those whose close-on-exec flag The state of conversion descriptors and message catalog descriptors in the new process image is undefined. For the new process, the equivalent of:
is executed at startup. Signals set to the signal action After a successful call to any of the If the set-user-ID mode bit is set for the new process image file (see also Any shared memory segments attached to the calling process image will not be attached to the new process image (see also The new process also inherits the following attributes from the calling process image:
All other process attributes of the XPG4-compliant library functions will be the same in the new and old process images. Upon successful completion, the POSIX files are closed on calling an If threads are used, then the function affects the process or a thread in the following manner:
| |
Return val. | -1 | if an error occurs. |
Errors | The | |
|
| The number of bytes used by the argument list and environment list of the new process image is greater than the system-imposed limit of |
|
| Search permission is denied for a directory listed in the path prefix of the new process image, |
| Extension | |
|
| The program could not be loaded. A signal was caught. Too many symbolic links were encountered in resolving path or file. (End) |
|
| |
The length of the path or file arguments, or an element of the environment variable | ||
| Extension | |
|
| One or more components of the pathname of the new process image file does not exist, |
|
| A new process image requires more memory than is allowed by the hardware or system-imposed memory management constraints. |
|
| A component of the path prefix of the new process image file is not a directory. (End) |
The | ||
|
| The new process image file has the appropriate access permissions, but is not in the proper format. |
Notes | Since the state of conversion descriptors and message catalog descriptors in the new process image is undefined, portable applications should not rely on their use and should close them prior to calling one of the Before the program to be executed is loaded, the environment variables | |
See also |
|