Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- #include <errno.h>
- #include <string.h>
- #include <sys/types.h>
- #include <sys/wait.h>
- int main(){
- //printf("Mój PID = %d\n",getpid()); //indetyfikator procesu
- //errno=-1;
- //printf("Error in fork = %d %s\n", errno,strerror(errno));
- pid_t pid;
- int wynik;
- pid = fork();
- if(pid == 0)
- {
- wynik = execlp("ps","ps","aux",NULL);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment