Zephyr API Documentation  3.6.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"
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15#define SIGHUP 1
16#define SIGINT 2
17#define SIGQUIT 3
18#define SIGILL 4
19#define SIGTRAP 5
20#define SIGABRT 6
21#define SIGBUS 7
22#define SIGFPE 8
23#define SIGKILL 9
24#define SIGUSR1 10
25#define SIGSEGV 11
26#define SIGUSR2 12
27#define SIGPIPE 13
28#define SIGALRM 14
29#define SIGTERM 15
30/* 16 not used */
31#define SIGCHLD 17
32#define SIGCONT 18
33#define SIGSTOP 19
34#define SIGTSTP 20
35#define SIGTTIN 21
36#define SIGTTOU 22
37#define SIGURG 23
38#define SIGXCPU 24
39#define SIGXFSZ 25
40#define SIGVTALRM 26
41#define SIGPROF 27
42/* 28 not used */
43#define SIGPOLL 29
44/* 30 not used */
45#define SIGSYS 31
47#define RTSIG_MAX CONFIG_POSIX_RTSIG_MAX
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
80typedef int sig_atomic_t; /* Atomic entity type (ANSI) */
81
82union sigval {
83 void *sival_ptr;
85};
86
87struct sigevent {
88 void (*sigev_notify_function)(union sigval val);
89 pthread_attr_t *sigev_notify_attributes;
93};
94
95#ifdef CONFIG_POSIX_SIGNAL
96char *strsignal(int signum);
97int sigemptyset(sigset_t *set);
98int sigfillset(sigset_t *set);
99int sigaddset(sigset_t *set, int signo);
100int sigdelset(sigset_t *set, int signo);
101int sigismember(const sigset_t *set, int signo);
102int sigprocmask(int how, const sigset_t *ZRESTRICT set, sigset_t *ZRESTRICT oset);
103
104int pthread_sigmask(int how, const sigset_t *ZRESTRICT set, sigset_t *ZRESTRICT oset);
105#endif /* CONFIG_POSIX_SIGNAL */
106
107#ifdef __cplusplus
108}
109#endif
110
111#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:336
int sig_atomic_t
Definition: signal.h:80
#define RTSIG_MAX
Definition: signal.h:47
Definition: signal.h:87
pthread_attr_t * sigev_notify_attributes
Definition: signal.h:89
int sigev_signo
Definition: signal.h:92
union sigval sigev_value
Definition: signal.h:90
int sigev_notify
Definition: signal.h:91
void(* sigev_notify_function)(union sigval val)
Definition: signal.h:88
Definition: signal.h:54
Definition: signal.h:82
void * sival_ptr
Definition: signal.h:83
int sival_int
Definition: signal.h:84