File: mysigact.c

package info (click to toggle)
leafnode 1.11.11-1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 2,468 kB
  • sloc: ansic: 10,914; sh: 1,748; xml: 628; makefile: 291; perl: 84; sed: 4
file content (17 lines) | stat: -rw-r--r-- 390 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "leafnode.h"

#include "config.h"
#include <signal.h>
#include "mysigact.h"

int mysigact(int sig, int flags, void (* func)(int), int blockthis)
{
    struct sigaction sa;

    sa.sa_handler = func;
    sa.sa_flags = SA_NOCLDSTOP | flags;
    sigemptyset(&sa.sa_mask);
    if (blockthis)
	sigaddset(&sa.sa_mask, blockthis);
    return sigaction(sig, &sa, (struct sigaction *)0);
}