-
Notifications
You must be signed in to change notification settings - Fork 0
/
signal.c
32 lines (25 loc) · 1.73 KB
/
signal.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
29
30
31
32
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* signal.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nmota-bu <nmota-bu@student.42barcel> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/09/19 18:57:21 by nmota-bu #+# #+# */
/* Updated: 2022/09/27 17:44:57 by nmota-bu ### ########.fr */
/* */
/* ************************************************************************** */
/* ╔════════════════════════════════════════════════════════════════════════╗ */
/* ║ https://github.com/nach131/42Barcelona ║ */
/* ╚════════════════════════════════════════════════════════════════════════╝ */
// sig_t signal(int sig, sig_t func);
#include <stdio.h>
#include <signal.h>
int main(void)
{
char s[1024];
signal(SIGINT, SIG_IGN); // Ignore SIGINT, caused by CTRL + C
printf("Try hitting CTRL + C (^C)... (hit RETURN to exit)\n");
// Wait for a line of input so the program doesn't just exit
fgets(s, sizeof s, stdin);
}