-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.c
More file actions
37 lines (33 loc) · 1.22 KB
/
Copy pathserver.c
File metadata and controls
37 lines (33 loc) · 1.22 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
35
36
37
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* server.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kenakamu <kenakamu@student.42tokyo.jp> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/09/09 14:09:40 by kenakamu #+# #+# */
/* Updated: 2025/09/09 14:23:41 by kenakamu ### ########.fr */
/* */
/* ************************************************************************** */
#include "minitalk.h"
int server(void)
{
pid_t pid;
struct sigaction sa;
pid = getpid();
ft_printf("Server PID: %d\n", pid);
sa.sa_sigaction = signal_handler;
sa.sa_flags = SA_SIGINFO;
sigemptyset(&sa.sa_mask);
sigaction(SIGUSR1, &sa, NULL);
sigaction(SIGUSR2, &sa, NULL);
while (1)
{
pause();
}
return (0);
}
int main(void)
{
server();
}