"Fossies" - the Fresh Open Source Software Archive

Member "leafnode-1.12.0/mysigact.c" (28 Dec 2021, 465 Bytes) of package /linux/misc/leafnode-1.12.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "mysigact.c" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.11.12_vs_1.12.0.

    1 /* (C) Copyright 2002 - 2010 Matthias Andree, see COPYING for license. */
    2 
    3 #include "leafnode.h"
    4 
    5 #include "config.h"
    6 #include <signal.h>
    7 #include "mysigact.h"
    8 
    9 int mysigact(int sig, int flags, void (* func)(int), int blockthis)
   10 {
   11     struct sigaction sa;
   12 
   13     sa.sa_handler = func;
   14     sa.sa_flags = SA_NOCLDSTOP | flags;
   15     sigemptyset(&sa.sa_mask);
   16     if (blockthis)
   17     sigaddset(&sa.sa_mask, blockthis);
   18     return sigaction(sig, &sa, (struct sigaction *)0);
   19 }