fork.c
changeset 139 cb1d3f4cf18e
parent 138 dff18d1ac2af
equal deleted inserted replaced
138:dff18d1ac2af 139:cb1d3f4cf18e
    16 
    16 
    17     pid = fork ();
    17     pid = fork ();
    18     switch (pid) {
    18     switch (pid) {
    19     case 0:
    19     case 0:
    20         printf ("Starting new Process\n");
    20         printf ("Starting new Process\n");
    21         return execve (cmd, argv, argp);
    21         execve (cmd, argv, argp);
       
    22         exit (EXIT_FAILURE);
    22     case -1:
    23     case -1:
    23         perror ("FORK");
    24         perror ("FORK");
    24         return errno;
    25         return errno;
    25     default:
    26     default:
    26         printf ("Pid started as %d\n", pid);
    27         printf ("Pid started as %d\n", pid);