-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.c
28 lines (25 loc) · 1.18 KB
/
server.c
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* server.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: llawrenc <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/01/02 19:33:24 by llawrenc #+# #+# */
/* Updated: 2022/01/03 14:59:20 by llawrenc ### ########.fr */
/* */
/* ************************************************************************** */
#include "minitalk.h"
int main(void)
{
struct sigaction act;
output_pid(getpid());
act.sa_sigaction = output_str;
act.sa_flags = SA_SIGINFO;
if (sigaction(SIGUSR1, &act, NULL) == -1
|| sigaction(SIGUSR2, &act, NULL) == -1)
write(2, "Error in signal processing.\n", 28);
while (1)
pause();
return (0);
}