Comment by cryptonector

7 years ago

vfork() is the right tool. I dunno what semantics you have in mind for p_execve().

(See man (2)execve.)

  int p_execve(pid_t target,char* filename,
               char** argv,char** envp);

Executes a new program, specified by filename, in the context of the specified process. On success, the text, data, bss, and stack of the process specified by target are overwritten by that of the program loaded.

A target of zero specifies the current process, so p_execve(0,file,argv,envp) is equivalent to execve(file,argv,envp).

BUGS

We should probably require some kind of permission check before allowing the calling process to do this.