/* This program just shows how to use the exec system call to start a new program (in this case ls) */ #include char *args[] = {"/bin/ls", NULL}; /* If all goes well, execls will never return, since the program is replaced with ls */ void execls(void) { execv("/bin/ls",args); printf("I'm not printed\n"); } int main(void) { execls(); return(0); }