Luna/libc/include/bits/signal.h

61 lines
1.1 KiB
C
Raw Normal View History

2023-07-10 17:46:57 +00:00
/* bits/signal.h: Signal-related definitions. */
#ifndef _BITS_SIGNAL_H
#define _BITS_SIGNAL_H
typedef void (*__simple_sighandler_t)(int);
#define SIG_IGN (__simple_sighandler_t)(-1)
#define SIG_DFL (__simple_sighandler_t)(-2)
typedef int sigset_t;
struct sigaction
{
__simple_sighandler_t sa_handler;
sigset_t sa_mask;
int sa_flags;
#ifdef __cplusplus
2023-07-10 17:46:57 +00:00
void* __sa_sigreturn = nullptr;
#else
void* __sa_sigreturn;
#endif
2023-07-10 17:46:57 +00:00
};
// Constants for sigaction's sa_flags field.
#define SA_NODEFER (1 << 0)
#define SA_RESETHAND (1 << 1)
// Constants for the 'how' parameter in sigprocmask().
#define SIG_BLOCK 0
#define SIG_UNBLOCK 1
#define SIG_SETMASK 2
// The signals with explicit numbers have portable signal numbers.
2023-07-10 17:46:57 +00:00
enum __signals
{
SIGHUP = 1,
SIGINT = 2,
SIGQUIT = 3,
SIGILL = 4,
SIGTRAP = 5,
SIGABRT = 6,
SIGCHLD,
SIGFPE = 8,
SIGKILL = 9,
SIGSTOP,
SIGSEGV = 11,
SIGCONT,
SIGPIPE = 13,
SIGALRM = 14,
SIGTERM = 15,
SIGTTIN = 16,
SIGTTOU = 17,
// FIXME: Add the remaining signals.
2023-07-10 17:46:57 +00:00
__NSIG,
};
#define NSIG (__NSIG - 1)
#endif