/* * Sample program for execve() system call - No.11 * * execve(2) - execute program * * Synopsis * #include * * int execve(const char *filename, char *const argv [], char *const envp[]); */ #include #include main() { char *argv[] = { "ls", "-l", NULL }; char *envp[] = { NULL }; /* argument list must be terminated by NULL */ /* the first element of argv must be the name of the program */ execve("/bin/ls", argv, envp); }