Zephyr API Documentation 4.0.0
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
49#define SIGRTMIN 32
50#define SIGRTMAX (SIGRTMIN + RTSIG_MAX)
51#define _NSIG (SIGRTMAX + 1)
52
53BUILD_ASSERT(RTSIG_MAX >= 0);
54
55typedef struct {
56 unsigned long sig[DIV_ROUND_UP(_NSIG, BITS_PER_LONG)];
57} sigset_t;
58
59#ifndef SIGEV_NONE
60#define SIGEV_NONE 1
61#endif
62
63#ifndef SIGEV_SIGNAL
64#define SIGEV_SIGNAL 2
65#endif
66
67#ifndef SIGEV_THREAD
68#define SIGEV_THREAD 3
69#endif
70
71#ifndef SIG_BLOCK
72#define SIG_BLOCK 0
73#endif
74#ifndef SIG_SETMASK
75#define SIG_SETMASK 1
76#endif
77#ifndef SIG_UNBLOCK
78#define SIG_UNBLOCK 2
79#endif
80
81#define SIG_DFL ((void *)0)
82#define SIG_IGN ((void *)1)
83#define SIG_ERR ((void *)-1)
84
85#define SI_USER 1
86#define SI_QUEUE 2
87#define SI_TIMER 3
88#define SI_ASYNCIO 4
89#define SI_MESGQ 5
90
91typedef int sig_atomic_t; /* Atomic entity type (ANSI) */
92
93union sigval {
94 void *sival_ptr;
96};
97
105
106typedef struct {
109 union sigval si_value;
110} siginfo_t;
111
112struct sigaction {
113 void (*sa_handler)(int signno);
116 void (*sa_sigaction)(int signo, siginfo_t *info, void *context);
117};
118
119typedef void (*sighandler_t)(int signo);
120
121unsigned int alarm(unsigned int seconds);
122int kill(pid_t pid, int sig);
123int pause(void);
124int raise(int signo);
125int sigaction(int sig, const struct sigaction *ZRESTRICT act, struct sigaction *ZRESTRICT oact);
127int sigsuspend(const sigset_t *sigmask);
128int sigwait(const sigset_t *ZRESTRICT set, int *ZRESTRICT signo);
129char *strsignal(int signum);
132int sigaddset(sigset_t *set, int signo);
133int sigdelset(sigset_t *set, int signo);
134int sigismember(const sigset_t *set, int signo);
135sighandler_t signal(int signo, sighandler_t handler);
136int sigprocmask(int how, const sigset_t *ZRESTRICT set, sigset_t *ZRESTRICT oset);
137
138int pthread_sigmask(int how, const sigset_t *ZRESTRICT set, sigset_t *ZRESTRICT oset);
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* ZEPHYR_INCLUDE_POSIX_SIGNAL_H_ */
#define BITS_PER_LONG
Number of bits in a long int.
Definition util.h:70
#define DIV_ROUND_UP(n, d)
Divide and round up.
Definition util.h:352
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:91
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:119
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:36
#define RTSIG_MAX
Definition posix_features.h:326
int pid_t
Definition posix_types.h:79
Definition posix_types.h:97
Definition signal.h:112
void(* sa_handler)(int signno)
Definition signal.h:113
void(* sa_sigaction)(int signo, siginfo_t *info, void *context)
Definition signal.h:116
sigset_t sa_mask
Definition signal.h:114
int sa_flags
Definition signal.h:115
Definition signal.h:98
pthread_attr_t * sigev_notify_attributes
Definition signal.h:100
int sigev_signo
Definition signal.h:103
union sigval sigev_value
Definition signal.h:101
int sigev_notify
Definition signal.h:102
void(* sigev_notify_function)(union sigval val)
Definition signal.h:99
Definition signal.h:106
int si_code
Definition signal.h:108
int si_signo
Definition signal.h:107
Definition signal.h:55
Definition signal.h:93
void * sival_ptr
Definition signal.h:94
int sival_int
Definition signal.h:95