This commit is contained in:
p-w-rs
2022-09-15 14:38:32 -05:00
parent 3d122bd7fb
commit 59e3d32e38
10 changed files with 64 additions and 54 deletions

View File

@@ -3,10 +3,10 @@
* for the interrupt (CTRL+C) signal
*/
#include <sys/types.h> // needed for pid_t
#include <unistd.h> // needed for getpid, sleep system calls
#include <signal.h> // needed for signal system call
#include <stdio.h> // needed for printf
#include <sys/types.h> // needed for pid_t
#include <unistd.h> // needed for getpid, sleep system calls
// Signal handler
// Prints the PID of the process and the received signal
@@ -22,7 +22,8 @@ int main()
signal(SIGINT, signal_handler);
// Loop forever and sleep
while(1) {
while (1)
{
printf("sleeping...\n");
sleep(1);
}