qfedu-linux-advanced-level/day3/test_execve.c

12 lines
220 B
C
Raw Permalink Normal View History

2023-08-17 09:20:18 +08:00
#include <stdio.h>
#include <unistd.h>
int main()
{
char *const argv[] = {"ls", "-l", NULL};
char *const envp[] = {"PATH=/usr/local/bin", "TERM=vt100", NULL};
execve("/bin/ls", argv, envp);
return 0;
}