C   56

exec

Guest on 1st June 2022 01:32:08 AM

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <unistd.h>
  4. #include <sys/wait.h>
  5.  
  6. int
  7. main(int argc, char *argv[])
  8. {
  9.   int status;
  10.   printf("about to run program %s.\n", argv[0]);
  11.     execve(argv[0], argv, 0);
  12.     perror("exec failed");
  13. }

Raw Paste


Login or Register to edit or fork this paste. It's free.