Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<signal.h>
- #include<unistd.h>
- #include<signal.h>
- #include<sys/types.h>
- #include<sys/wait.h>
- #include<stdio.h>
- #include<pwd.h>
- int main()
- {
- int pid, S = 1;
- printf("%s", "Podaj pid serwera: ");
- scanf("%d", &pid);
- while(S)
- {
- printf("Wybierz typ akcji:\n0 - zakoncz\n1 - SIGUSR1\n2 - SIGUSR2\n");
- printf("Twoj wybor: ");
- scanf("%d", &S);
- switch(S)
- {
- case 0:
- return 0;
- break;
- case 1:
- kill(pid, SIGUSR1);
- break;
- case 2:
- kill(pid, SIGUSR2);
- break;
- default: printf("Niepoprawna opcja!\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement