fork download
  1. #include <stdio.h>
  2. #include <unistd.h>
  3.  
  4. int main(void) {
  5. printf("Before exec()\n");
  6. execl("/bin/ls", "ls","-1", NULL);
  7. printf("This line will not be printed if exec is succesful\n");
  8. return 0;
  9. }
  10.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
prog