Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int launch(char **args)
- {
- pid_t pid, wpid;
- /*Fork a childprocess */
- pid = fork();
- if (pid<0)
- {
- /*Error during the Forking */
- fprintf(stderr, "Fork Failed!");
- }
- else if (pid== 0)
- {
- /*Child process */
- execvp(/*to be filled*/)
- }
- else
- {
- /*Parent process is waiting for the child to complete,
- we don't want orphans */
- wait(null);
- printf("Child complete")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement