Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 741 Bytes

execv.md

File metadata and controls

27 lines (17 loc) · 741 Bytes

Syscall execv

User Mode

#include <unistd.h>
int32_t execv(const char *pathname, char *argv[]);

Execute program at pathname replacing the currently running process. argv is a NULL terminated array of program parameters, argv[0] contains the programs name by convention.

Note: The open file descriptors stay the same.

Returns:

  • -1 on error (e.g. file to execute not found)
  • won't return on success

Kernel Mode

Implemented in sys_process.c as sys_execv().

See also

Overview: syscalls

Process Control Syscalls: fork | execv | exit | kill | ms_sleep | wait | chdir | sbrk