Zephyr API 3.6.99
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"
10#include "posix_features.h"
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#define SIGHUP 1
17#define SIGINT 2
18#define SIGQUIT 3
19#define SIGILL 4
20#define SIGTRAP 5
21#define SIGABRT 6
22#define SIGBUS 7
23#define SIGFPE 8
24#define SIGKILL 9
25#define SIGUSR1 10
26#define SIGSEGV 11
27#define SIGUSR2 12
28#define SIGPIPE 13
29#define SIGALRM 14
30#define SIGTERM 15
31/* 16 not used */
32#define SIGCHLD 17
33#define SIGCONT 18
34#define SIGSTOP 19
35#define SIGTSTP 20
36#define SIGTTIN 21
37#define SIGTTOU 22
38#define SIGURG 23
39#define SIGXCPU 24
40#define SIGXFSZ 25
41#define SIGVTALRM 26
42#define SIGPROF 27
43/* 28 not used */
44#define SIGPOLL 29
45/* 30 not used */
46#define SIGSYS 31
48#define SIGRTMIN 32
49#define SIGRTMAX (SIGRTMIN + RTSIG_MAX)
50#define _NSIG (SIGRTMAX + 1)
51
52BUILD_ASSERT(RTSIG_MAX >= 0);
53
54typedef struct {
55 unsigned long sig[DIV_ROUND_UP(_NSIG, BITS_PER_LONG)];
56} sigset_t;
57
58#ifndef SIGEV_NONE
59#define SIGEV_NONE 1
60#endif
61
62#ifndef SIGEV_SIGNAL
63#define SIGEV_SIGNAL 2
64#endif
65
66#ifndef SIGEV_THREAD
67#define SIGEV_THREAD 3
68#endif
69
70#ifndef SIG_BLOCK
71#define SIG_BLOCK 0
72#endif
73#ifndef SIG_SETMASK
74#define SIG_SETMASK 1
75#endif
76#ifndef SIG_UNBLOCK
77#define SIG_UNBLOCK 2
78#endif
79
80#define SIG_DFL ((void *)0)
81#define SIG_IGN ((void *)1)
82#define SIG_ERR ((void *)-1)
83
84#define SI_USER 1
85#define SI_QUEUE 2
86#define SI_TIMER 3
87#define SI_ASYNCIO 4
88#define SI_MESGQ 5
89
90typedef int sig_atomic_t; /* Atomic entity type (ANSI) */
91
92union sigval {
93 void *sival_ptr;
95};
96
104
105typedef struct {
108 union sigval si_value;
109} siginfo_t;
110
111struct sigaction {
112 void (*sa_handler)(int signno);
115 void (*sa_sigaction)(int signo, siginfo_t *info, void *context);
116};
117
118typedef void (*sighandler_t)(int signo);
119
120unsigned int alarm(unsigned int seconds);
121int kill(pid_t pid, int sig);
122int pause(void);
123int raise(int signo);
124int sigaction(int sig, const struct sigaction *ZRESTRICT act, struct sigaction *ZRESTRICT oact);
126int sigsuspend(const sigset_t *sigmask);
127int sigwait(const sigset_t *ZRESTRICT set, int *ZRESTRICT signo);
128char *strsignal(int signum);
131int sigaddset(sigset_t *set, int signo);
132int sigdelset(sigset_t *set, int signo);
133int sigismember(const sigset_t *set, int signo);
134sighandler_t signal(int signo, sighandler_t handler);
135int sigprocmask(int how, const sigset_t *ZRESTRICT set, sigset_t *ZRESTRICT oset);
136
137int pthread_sigmask(int how, const sigset_t *ZRESTRICT set, sigset_t *ZRESTRICT oset);
138
139#ifdef __cplusplus
140}
141#endif
142
143#endif /* ZEPHYR_INCLUDE_POSIX_SIGNAL_H_ */
#define ZRESTRICT
Definition common.h:36
#define BITS_PER_LONG
Number of bits in a long int.
Definition util.h:61
#define DIV_ROUND_UP(n, d)
Divide and round up.
Definition util.h:359
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)
int sigemptyset(sigset_t *set)
int raise(int signo)
int sig_atomic_t
Definition signal.h:90
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:118
int sigdelset(sigset_t *set, int signo)
int sigaddset(sigset_t *set, int signo)
sighandler_t signal(int signo, sighandler_t handler)
#define RTSIG_MAX
Definition posix_features.h:326
int pid_t
Definition posix_types.h:67
Definition posix_types.h:85
Definition signal.h:111
void(* sa_handler)(int signno)
Definition signal.h:112
void(* sa_sigaction)(int signo, siginfo_t *info, void *context)
Definition signal.h:115
sigset_t sa_mask
Definition signal.h:113
int sa_flags
Definition signal.h:114
Definition signal.h:97
pthread_attr_t * sigev_notify_attributes
Definition signal.h:99
int sigev_signo
Definition signal.h:102
union sigval sigev_value
Definition signal.h:100
int sigev_notify
Definition signal.h:101
void(* sigev_notify_function)(union sigval val)
Definition signal.h:98
Definition signal.h:105
int si_code
Definition signal.h:107
int si_signo
Definition signal.h:106
Definition signal.h:54
Definition signal.h:92
void * sival_ptr
Definition signal.h:93
int sival_int
Definition signal.h:94