aboutsummaryrefslogtreecommitdiff
path: root/src/signal/handler.cc
blob: 294ae53233ff7fe25cf79b6f16690489372b08a1 (plain)
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

#include "signal_handler.h"

#include <print>
#include <signal.h>
#include <cstdio>

using namespace std;

namespace ov4
{

void process_signal()
{
    /*
     * do NOT swap these statements
     * otherwise, if process then unset flag, and another signal delivered
     * it won't be processed
     */
    if (check_signal_delivered(SIGCHLD))
    {
        unset_signal_delivered(SIGCHLD);
        process_sigchld();
    }
}

void process_sigchld()
{
    print("hi\r\n");
    fflush(stdout);
}

}