Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int shell_fork(char **arguments){
- pid_t pid;
- pid = fork();
- if(pid== -1){
- perror("\033[0;31m""ERROR""\033[0m");
- }
- else if (pid == 0){
- execvp(arguments[0], arguments);
- perror("\033[0;31m""ERROR""\033[0m");
- exit(EXIT_FAILURE);
- }
- else{
- wait(NULL);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement