Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (e) execl(2)
NAME
execl - Executes a file using a pathname, a set of argument strings, and **environ
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 execl(
const char ∗∗path,
const char ∗∗arg, ...);
PARAMETERS
**environ Points to an array of character pointers to environment strings. The environment
strings define the OSS environment for the new process. The environ array is
terminated by a null pointer.
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.
arg Points to a null-terminated string containing an argument to be made visible to
the main function of the new program. The first such argument should point to
the null-terminated string containing the filename of the new process image. The
last of these arguments must be a null pointer.
These strings constitute the argument list available to the new process image.
DESCRIPTION
The execl() 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.
A successful execl() function call does not return, because the calling process image is overlaid
by the new process image.
Entering the New Process
When a program is executed as a result of a call to a function in the exec set of functions, it is
entered as a function call as follows:
int main(
int argc,
char ∗∗argv [],
char ∗∗env[]);
Here, the argc parameter is the argument count, the argv[]parameter is an array of character
pointers to the arguments themselves, and env[]is a pointer to a character array listing the
527186-023 Hewlett-Packard Company 2−3