fork download
  1. #include <stdio.h>
  2. #include <unistd.h>
  3. int main() {
  4. printf("Before exec()\n");
  5. execl("/bin/ls", "ls", "-l", (char *) NULL);
  6. printf("After exec()\n");
  7. return 0;
  8. }
  9.  
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
total 16
-rwxr-xr-x 1 root root 14312 Jan 30 04:21 prog