about fork and execve system call

前端 未结 5 1717
难免孤独
难免孤独 2021-02-02 18:11

It is said that fork system call creates a clone of the calling process, and then (usually) the child process issues execve system call to change its i

5条回答
  •  失恋的感觉
    2021-02-02 18:51

    • exec: Execute new process
    • v : use array of arguments
    • e: Specify as well the environment

    Other variations of exec abound:

    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[]);
    
    • l: list arg on function
    • p: use $PATH to locate executable file

提交回复
热议问题