|
|
MPE/iX Developer's Kit Reference Manual Volume I: HP 3000 MPE/iX Computer Systems > Chapter 4
POSIX/iX Library Function Descriptions
execv |
|
Executes a file.
The execv() function replaces the current process image with a new process image created from the executable file specified by pathname. Use the execl() function if you know the exact number of arguments to be passed to the new process image. Use the execv() function if the number of arguments passed to the new process image might vary at run time. If the new process image is a C program, it is entered as a C function call having the following declaration:
In the above declaration, argc is a count of the number of pointers in the array argv[]. The NULL pointer terminating argv[] is not counted in argc. The environment for the new process image is identical to the environment of the calling process. If the new process image is not a C program, no information is made available through the argument list in argv[]. The sum of the bytes used in both the argument list and environment list must not exceed {ARG_MAX} (defined in the file <limits.h>). File descriptors open in the calling process image remain open in the new process image. For all file descriptors that remain open, all attributes of the open file description remain unchanged by this function, including file locks. Streams open in the calling process image are not accessible in the new process image. (However, the underlying file descriptors that remain open, but inaccessible, are counted towards {OPEN_MAX}.) Signals set to SIG_DFL or SIG_IGN in the calling process remain unchanged in the new process image. All signals of the calling process whose action is to invoke a signal handling function are set to SIG_DFL in the new process image. The following attributes of the new process image are set to the same values of those of the calling process:
The executable file's st_atime time field is marked for update. If the execv() function succeeds, the executable file is open until the new process image terminates or executes another of the exec() functions. Refer to the EPERM, EIMPL, and ENOEXEC error descriptions below. Some MPE/iX process attributes that are not specified in the POSIX 1003.1 standard are not inherited by the new process image. NULL terminators and pointers are counted against {ARG_MAX}. Alignment bytes are counted against {ARG_MAX}. The calling process's privilege level is used as the new program's maximum privilege level. If the calling process entered debug mode through the ;DEBUG option of the MPE/iX CI RUN command, the new process image is also in debug mode. If an error occurs, errno is set to one of the following values:
|
|