Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (e) execve(2)
NAME
execve - Executes a file using a pathname, an argv array, and an envp array
LIBRARY
G-series native OSS processes: /G/system/sysnn/zossksrl
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zosskdll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/yosskdll
SYNOPSIS
#include <unistd.h>
extern char ∗∗∗∗environ;
int execve(
const char ∗∗path,
char ∗∗ const argv[],
char ∗∗ const envp[ ]);
PARAMETERS
**environ Points to an array of character pointers to environment strings. The environment
strings define the OSS environment for the calling process. The environ array is
terminated by a null pointer.
When the new process is created, the corresponding **environ array is not ini-
tialized for it with the content of the **environ array of the calling process.
Instead, the envp[]array is written into the **environ array of the new process
when the execve() function call is processed.
The **environ array of the new process is also passed as the env[]array in the
call to the main() function of the new process. Refer to Entering the New Pro-
cess later in this reference page.
path Points to a null-terminated string containing a pathname that identifies the new
process image file. The pathname is absolute if it starts with a slash (/) character.
Otherwise, the pathname is relative and is resolved by prefixing the current
working directory.
If the final component of the path parameter names a symbolic link, the link is
traversed and pathname resolution continues.
argv[] Specifies an array of character pointers to null-terminated strings containing
arguments to be passed to the main function of the new program. argv[0] should
point to the null-terminated string containing the filename of the new process
image. The last member of this array must be a null pointer.
These strings constitute the argument list available to the new process image.
envp[] Specifies an array of character pointers to null-terminated strings that describe
the environment for the new process. The last member of this array must be a
null pointer.
DESCRIPTION
The execve() function is one of the exec set of functions. The exec set of functions replace the
current process image with a new process image. The new image is constructed from a regular
executable file, called a new process image file. The new process image file is formatted as an
executable text or binary file in one of the formats recognized by the exec set of functions.
527186-023 Hewlett-Packard Company 2−35