Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
signal.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Intel Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6#ifndef ZEPHYR_INCLUDE_POSIX_SIGNAL_H_
7#define ZEPHYR_INCLUDE_POSIX_SIGNAL_H_
8
9/* include posix_types.h before posix_features.h (here) to avoid build errors against newlib */
11#include "posix_features.h"
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17#define SIGHUP 1
18#define SIGINT 2
19#define SIGQUIT 3
20#define SIGILL 4
21#define SIGTRAP 5
22#define SIGABRT 6
23#define SIGBUS 7
24#define SIGFPE 8
25#define SIGKILL 9
26#define SIGUSR1 10
27#define SIGSEGV 11
28#define SIGUSR2 12
29#define SIGPIPE 13
30#define SIGALRM 14
31#define SIGTERM 15
32/* 16 not used */
33#define SIGCHLD 17
34#define SIGCONT 18
35#define SIGSTOP 19
36#define SIGTSTP 20
37#define SIGTTIN 21
38#define SIGTTOU 22
39#define SIGURG 23
40#define SIGXCPU 24
41#define SIGXFSZ 25
42#define SIGVTALRM 26
43#define SIGPROF 27
44/* 28 not used */
45#define SIGPOLL 29
46/* 30 not used */
47#define SIGSYS 31
48
49#define SIGRTMIN 32
50#if defined(CONFIG_POSIX_REALTIME_SIGNALS) || defined(__DOXYGEN__)
51BUILD_ASSERT(CONFIG_POSIX_RTSIG_MAX >= 0);
52#define SIGRTMAX (SIGRTMIN + CONFIG_POSIX_RTSIG_MAX)
53#else
54#define SIGRTMAX SIGRTMIN
55#endif
56
57typedef struct {
58 unsigned long sig[DIV_ROUND_UP(SIGRTMAX + 1, BITS_PER_LONG)];
59} sigset_t;
60
61#ifndef SIGEV_NONE
62#define SIGEV_NONE 1
63#endif
64
65#ifndef SIGEV_SIGNAL
66#define SIGEV_SIGNAL 2
67#endif
68
69#ifndef SIGEV_THREAD
70#define SIGEV_THREAD 3
71#endif
72
73#ifndef SIG_BLOCK
74#define SIG_BLOCK 0
75#endif
76#ifndef SIG_SETMASK
77#define SIG_SETMASK 1
78#endif
79#ifndef SIG_UNBLOCK
80#define SIG_UNBLOCK 2
81#endif
82
83#define SIG_DFL ((void *)0)
84#define SIG_IGN ((void *)1)
85#define SIG_ERR ((void *)-1)
86
87#define SI_USER 1
88#define SI_QUEUE 2
89#define SI_TIMER 3
90#define SI_ASYNCIO 4
91#define SI_MESGQ 5
92
93typedef int sig_atomic_t; /* Atomic entity type (ANSI) */
94
95union sigval {
96 void *sival_ptr;
98};
99
107
108typedef struct {
112} siginfo_t;
113
114struct sigaction {
115 void (*sa_handler)(int signno);
118 void (*sa_sigaction)(int signo, siginfo_t *info, void *context);
119};
120
121typedef void (*sighandler_t)(int signo);
122
123unsigned int alarm(unsigned int seconds);
124int kill(pid_t pid, int sig);
125int pause(void);
126int raise(int signo);
128int sigaction(int sig, const struct sigaction *ZRESTRICT act, struct sigaction *ZRESTRICT oact);
131int sigsuspend(const sigset_t *sigmask);
132int sigwait(const sigset_t *ZRESTRICT set, int *ZRESTRICT signo);
133char *strsignal(int signum);
136int sigaddset(sigset_t *set, int signo);
137int sigdelset(sigset_t *set, int signo);
138int sigismember(const sigset_t *set, int signo);
139sighandler_t signal(int signo, sighandler_t handler);
140int sigprocmask(int how, const sigset_t *ZRESTRICT set, sigset_t *ZRESTRICT oset);
141
142int pthread_sigmask(int how, const sigset_t *ZRESTRICT set, sigset_t *ZRESTRICT oset);
143
144#ifdef __cplusplus
145}
146#endif
147
148#endif /* ZEPHYR_INCLUDE_POSIX_SIGNAL_H_ */
#define BITS_PER_LONG
Number of bits in a long int.
Definition util.h:71
#define DIV_ROUND_UP(n, d)
Divide and round up.
Definition util.h:353
int pthread_sigmask(int how, const sigset_t *ZRESTRICT set, sigset_t *ZRESTRICT oset)
int sigsuspend(const sigset_t *sigmask)
int sigismember(const sigset_t *set, int signo)
int sigwait(const sigset_t *ZRESTRICT set, int *ZRESTRICT signo)
int kill(pid_t pid, int sig)
int pause(void)
#define SIGRTMAX
Definition signal.h:52
int sigemptyset(sigset_t *set)
int raise(int signo)
int sig_atomic_t
Definition signal.h:93
int sigaction(int sig, const struct sigaction *ZRESTRICT act, struct sigaction *ZRESTRICT oact)
int sigprocmask(int how, const sigset_t *ZRESTRICT set, sigset_t *ZRESTRICT oset)
int sigpending(sigset_t *set)
int sigfillset(sigset_t *set)
char * strsignal(int signum)
unsigned int alarm(unsigned int seconds)
void(* sighandler_t)(int signo)
Definition signal.h:121
int sigdelset(sigset_t *set, int signo)
int sigaddset(sigset_t *set, int signo)
sighandler_t signal(int signo, sighandler_t handler)
#define ZRESTRICT
Definition common.h:37
struct pthread_attr pthread_attr_t
Definition posix_types.h:98
int pid_t
Definition posix_types.h:79
Definition signal.h:114
void(* sa_handler)(int signno)
Definition signal.h:115
void(* sa_sigaction)(int signo, siginfo_t *info, void *context)
Definition signal.h:118
sigset_t sa_mask
Definition signal.h:116
int sa_flags
Definition signal.h:117
Definition signal.h:100
pthread_attr_t * sigev_notify_attributes
Definition signal.h:102
int sigev_signo
Definition signal.h:105
union sigval sigev_value
Definition signal.h:103
int sigev_notify
Definition signal.h:104
void(* sigev_notify_function)(union sigval val)
Definition signal.h:101
Definition signal.h:108
int si_code
Definition signal.h:110
int si_signo
Definition signal.h:109
union sigval si_value
Definition signal.h:111
Definition signal.h:57
unsigned long sig[DIV_ROUND_UP((32+CONFIG_POSIX_RTSIG_MAX)+1, BITS_PER_LONG)]
Definition signal.h:58
#define TOOLCHAIN_DISABLE_WARNING(warning)
Disable the specified compiler warning for all compilers.
Definition toolchain.h:254
#define TOOLCHAIN_ENABLE_WARNING(warning)
Re-enable the specified compiler warning for all compilers.
Definition toolchain.h:264
#define TOOLCHAIN_WARNING_SHADOW
Toolchain-specific warning for shadow variables.
Definition toolchain.h:224
Definition signal.h:95
void * sival_ptr
Definition signal.h:96
int sival_int
Definition signal.h:97