-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path013s.c
More file actions
34 lines (29 loc) · 1.2 KB
/
013s.c
File metadata and controls
34 lines (29 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
..........................................................................................................................................
Name : 013(sender).c
Author : SHRUTI VERMA
Description : Write two programs: first program is waiting to catch SIGSTOP signal, the second program
will send the signal (using kill system call). Find out whether the first program is able to catch
the signal or not.
Date : 20 Sep 2025
..........................................................................................................................................
*/
#include<unistd.h>
#include<stdio.h>
#include<stdlib.h>
#include<signal.h>
int main() {
int pid;
printf("Give the pid of the process to stop(reciever)\n");
scanf("%d", &pid);
kill(pid, SIGSTOP);
printf("Signal sent to stop the process\n");
return 0;
}
/*----------------------------------OUTPUT----------------------------------------------------------------
vumma@vumma-VivoBook-15-ASUS-Laptop-X507UF:~/Desktop/SS/HOL2$ gcc 013s.c -o 13s
vumma@vumma-VivoBook-15-ASUS-Laptop-X507UF:~/Desktop/SS/HOL2$ ./13s
Give the pid of the process to stop(reciever)
14715
Signal sent to stop the process
*/