Open System Services System Calls Reference Manual (G06.25+, H06.03+)

System Functions (e) execve(2)
NAME
execve - Executes a le using a pathname, an argv array, and an envp array
LIBRARY
G-series native OSS processes: /G/system/sysnn/zossksrl
H-series OSS processes: /G/system/zdllnnn/zosskdll
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 dene 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 identies the new
process image le. The pathname is absolute if it starts with a slash (/) character.
Otherwise, the pathname is relative and is resolved by prexing the current
working directory.
If the nal component of the path parameter names a symbolic link, the link is
traversed and pathname resolution continues.
argv[] Species 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 lename 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[] Species 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 le, called a new process image le. The new process image le is formatted as an
executable text or binary le in one of the formats recognized by the exec set of functions.
527186-003 Hewlett-Packard Company 235