bfin: remove inline keyword
[xenomai-head.git] / include / posix / signal.h
blobe3a49210cc1856028731df8c24d8504a65d73cc6
1 /*
2 * Copyright (C) 2006 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 #ifndef _XENO_POSIX_SIGNAL_H
20 #define _XENO_POSIX_SIGNAL_H
22 #if defined(__KERNEL__) || defined(__XENO_SIM__)
24 #include <nucleus/xenomai.h>
26 #ifdef __KERNEL__
27 #include <linux/signal.h>
29 /* These are not defined in kernel-space headers. */
30 #define sa_sigaction sa_handler
31 typedef void (*sighandler_t) (int sig);
32 typedef unsigned long sig_atomic_t;
33 #endif /* __KERNEL__ */
35 #ifdef __XENO_SIM__
36 #include <posix_overrides.h>
37 #endif /* __XENO_SIM__ */
39 #undef sigemptyset
40 #undef sigfillset
41 #undef sigaddset
42 #undef sigdelset
43 #undef sigismember
44 #undef sigaction
45 #undef sigqueue
46 #undef SIGRTMIN
47 #undef SIGRTMAX
49 #define sigaction(sig, action, old) pse51_sigaction(sig, action, old)
50 #define sigemptyset pse51_sigemptyset
51 #define sigfillset pse51_sigfillset
52 #define sigaddset pse51_sigaddset
53 #define sigdelset pse51_sigdelset
54 #define sigismember pse51_sigismember
56 #define SIGRTMIN 33
57 #define SIGRTMAX 64
59 struct pse51_thread;
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
65 int sigemptyset(sigset_t *set);
67 int sigfillset(sigset_t *set);
69 int sigaddset(sigset_t *set,
70 int signum);
72 int sigdelset(sigset_t *set,
73 int signum);
75 int sigismember(const sigset_t *set,
76 int signum);
78 int pthread_kill(struct pse51_thread *thread,
79 int sig);
81 int pthread_sigmask(int how,
82 const sigset_t *set,
83 sigset_t *oset);
85 int sigaction(int sig,
86 const struct sigaction *action,
87 struct sigaction *old);
89 int sigpending(sigset_t *set);
91 int sigwait(const sigset_t *set,
92 int *sig);
94 /* Real-time signals. */
95 int sigwaitinfo(const sigset_t *__restrict__ set,
96 siginfo_t *__restrict__ info);
98 int sigtimedwait(const sigset_t *__restrict__ user_set,
99 siginfo_t *__restrict__ info,
100 const struct timespec *__restrict__ timeout);
102 int pthread_sigqueue_np (struct pse51_thread *thread, int sig, union sigval value);
104 #ifdef __cplusplus
106 #endif
108 #else /* !(__KERNEL__ || __XENO_SIM__) */
110 #pragma GCC system_header
112 #include_next <signal.h>
113 /* In case signal.h is included for a side effect of an __need* macro, include
114 it a second time to get all definitions. */
115 #include_next <signal.h>
117 #endif /* !(__KERNEL__ || __XENO_SIM__) */
120 * Those are pseudo-signals only available with pthread_kill() to
121 * suspend/resume/unblock threads synchronously via the low-level
122 * nucleus interface. Can't block them, queue them, or even set them
123 * in a sigset. Those are nasty, strictly anti-POSIX things; we do
124 * provide them nevertheless only because we are mean people doing
125 * harmful code for no valid reason. Can't go against your nature,
126 * right? Nah... (this said, don't blame us for POSIX, we are not
127 * _that_ mean).
129 #define SIGSUSP (SIGRTMAX + 1)
130 #define SIGRESM (SIGRTMAX + 2)
131 #define SIGRELS (SIGRTMAX + 3)
133 #endif /* _XENO_POSIX_SIGNAL_H */