execle

Passes the name of an image to be activated in a child process. This function is nonreentrant.

Format

#include  <unistd.h>

int execle  (char *file_spec, char *arg0, . . . ,
            (char *)0, char *envp[]); (ISO POSIX-1)

int execle  (char *file_spec, . . . ); (Compatability)

Arguments

file_spec
The full file specification of a new image to be activated in the child process.
arg0, ...
A sequence of pointers to null-terminated character strings.

If the POSIX-1 format is used, at least one argument must be present and must point to a string that is the same as the new process file name (or its last component). (This pointer can also be the NULL pointer, but then execle would accomplish nothing.) The last pointer must be the NULL pointer. This is also the convention if the compatibility format is used.

envp
An array of strings that specifies the program's environment. Each string in envp has the following form:
name = value

The name can be one of the following names and the value is a null- terminated string to be associated with the name:

The last element in envp must be the NULL pointer.

When the operating system executes the program, it places a copy of the current environment vector (envp) in the external variable environ.

Description

See execl in this section for a description of how the exec functions operate.

Return Value
-1  Indicates failure. 


Previous Page | Next Page | Table of Contents | Index