X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/509574b18a3373030cd0d7b979499499ff06dd9b..2a49908006b177c4d6354309333d06b1b96e4887:/lunaix-os/includes/lunaix/signal.h?ds=sidebyside diff --git a/lunaix-os/includes/lunaix/signal.h b/lunaix-os/includes/lunaix/signal.h index c98441a..dbe9ce5 100644 --- a/lunaix-os/includes/lunaix/signal.h +++ b/lunaix-os/includes/lunaix/signal.h @@ -1,29 +1,34 @@ #ifndef __LUNAIX_SIGNAL_H #define __LUNAIX_SIGNAL_H -#define _SIG_NUM 8 +#include -#define _SIG_PENDING(bitmap, sig) ((bitmap) & (1 << (sig))) - -#define _SIGSEGV 0 -#define _SIGALRM 1 -#define _SIGCHLD 2 -#define _SIGCLD SIGCHLD -#define _SIGINT 3 -#define _SIGKILL 4 -#define _SIGSTOP 5 -#define _SIGCONT 6 - -#define _SIGNAL_UNMASKABLE ((1 << _SIGKILL) | (1 << _SIGSTOP)) +#define _SIG_NUM 16 -#define _SIG_BLOCK 1 -#define _SIG_UNBLOCK 2 -#define _SIG_SETMASK 3 - -typedef unsigned int sigset_t; -typedef void (*sighandler_t)(int); +#define _SIG_PENDING(bitmap, sig) ((bitmap) & (1 << (sig))) -void -signal_dispatch(); +#define _SIGSEGV SIGSEGV +#define _SIGALRM SIGALRM +#define _SIGCHLD SIGCHLD +#define _SIGCLD SIGCLD +#define _SIGINT SIGINT +#define _SIGKILL SIGKILL +#define _SIGSTOP SIGSTOP +#define _SIGCONT SIGCONT +#define _SIGTERM SIGTERM + +#define __SIGNAL(num) (1 << (num)) +#define __SIGSET(bitmap, num) (bitmap = bitmap | __SIGNAL(num)) +#define __SIGTEST(bitmap, num) (bitmap & __SIGNAL(num)) +#define __SIGCLEAR(bitmap, num) ((bitmap) = (bitmap) & ~__SIGNAL(num)) + +#define _SIGNAL_UNMASKABLE (__SIGNAL(_SIGKILL) | __SIGNAL(_SIGSTOP)) + +#define _SIG_BLOCK SIG_BLOCK +#define _SIG_UNBLOCK SIG_UNBLOCK +#define _SIG_SETMASK SIG_SETMASK + +int +signal_send(pid_t pid, int signum); #endif /* __LUNAIX_SIGNAL_H */