PatchworkOS  966e257
A non-POSIX operating system.
Loading...
Searching...
No Matches
signal.h
Go to the documentation of this file.
1#ifndef _SIGNAL_H
2#define _SIGNAL_H 1
3
4#if defined(__cplusplus)
5extern "C"
6{
7#endif
8
9#include <stdatomic.h>
10
11#include "_internal/config.h"
12
13/**
14 * @brief Wrappers around "notes" for ANSI C signal handling.
15 * @defgroup libstd_signal Signal Handling
16 * @ingroup libstd
17 *
18 * For the same of compatibility with ANSI C, we provide these wrappers around "notes" for signal handling. However, it
19 * is preferred to use the native "notes" for IPC instead if possible.
20 *
21 * @{
22 */
23
24#define SIGABRT 1
25#define SIGFPE 2
26#define SIGILL 3
27#define SIGINT 4
28#define SIGSEGV 5
29#define SIGTERM 6
30#define SIGMAX 32
31
32#define SIG_DFL ((void (*)(int))0)
33#define SIG_ERR ((void (*)(int)) - 1)
34#define SIG_IGN ((void (*)(int))1)
35
36typedef _Atomic(int) sig_atomic_t;
37
38typedef void (*sighandler_t)(int);
39
41
42_PUBLIC int raise(int sig);
43
44/** @} */
45
46#if defined(__cplusplus)
47}
48#endif
49
50#endif
_PUBLIC int raise(int sig)
Definition raise.c:5
_PUBLIC sighandler_t signal(int sig, sighandler_t func)
Definition signal.c:5
void(* sighandler_t)(int)
Definition signal.h:38
#define _PUBLIC
Definition config.h:41
#define _Atomic(T)
Definition stdatomic.h:59