execl

NAME
execl, execlp, execle, execv, execvp - execute a file  
SYNOPSIS
#include <unistd.h>

extern char **environ;

int execl(const char *path, const char *arg, ...);
int execlp(const char *file, const char *arg, ...);
int execle(const char *path, const char *arg , ..., char * const envp[]);
int execv(const char *path, char *const argv[]);
int execvp(const char *file, char *const argv[]);  
DESCRIPTION


The exec family of functions replaces the current process image with a new process image.

RETURN VALUE
If any of the exec functions returns, an error will have occurred. The return value is -1, and the global variable errno will be set to indicate the error.

 

=========================================http://en.wikipedia.org/wiki/Exec_(operating_system)

The exec functions of Unix-like operating systems are a collection of functions that causes the running process to be completely replaced by the program passed as argument to the function. As a new process is not created, the process ID (PID) does not change across and execute, but the data, heap and stack of the calling process are replaced by those of the new process.

 

In the execl, execlp, execv, and execvp calls, the child process inherits the parent's environment.

 

Files open when an exec call is made remain open in the new process. All open files must be flushed before an exec call. The exec calls do not preserve the translation modes of open files. If the child process uses files inherited from the parent, setmode function can be called to set the translation mode to the desired mode.

你可能感兴趣的:(function,image,File,System,Path,translation)