• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

include/posix/signal.h

00001 /*
00002  * Copyright (C) 2006 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License as
00006  * published by the Free Software Foundation; either version 2 of the
00007  * License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018 
00019 #ifndef _XENO_POSIX_SIGNAL_H
00020 #define _XENO_POSIX_SIGNAL_H
00021 
00022 #if defined(__KERNEL__) || defined(__XENO_SIM__)
00023 
00024 #include <nucleus/xenomai.h>
00025 
00026 #ifdef __KERNEL__
00027 #include <linux/signal.h>
00028 
00029 /* These are not defined in kernel-space headers. */
00030 #define sa_sigaction sa_handler
00031 typedef void (*sighandler_t) (int sig);
00032 typedef unsigned long sig_atomic_t;
00033 #endif /* __KERNEL__ */
00034 
00035 #ifdef __XENO_SIM__
00036 #include <posix_overrides.h>
00037 #endif /* __XENO_SIM__ */
00038 
00039 #undef sigemptyset
00040 #undef sigfillset
00041 #undef sigaddset
00042 #undef sigdelset
00043 #undef sigismember
00044 #undef sigaction
00045 #undef sigqueue
00046 #undef SIGRTMIN
00047 #undef SIGRTMAX
00048 
00049 #define sigaction(sig, action, old) pse51_sigaction(sig, action, old)
00050 #define sigemptyset pse51_sigemptyset
00051 #define sigfillset pse51_sigfillset
00052 #define sigaddset pse51_sigaddset
00053 #define sigdelset pse51_sigdelset
00054 #define sigismember pse51_sigismember
00055 
00056 #define SIGRTMIN 33
00057 #define SIGRTMAX 64
00058 
00059 struct pse51_thread;
00060 
00061 #ifdef __cplusplus
00062 extern "C" {
00063 #endif
00064 
00065 int sigemptyset(sigset_t *set);
00066 
00067 int sigfillset(sigset_t *set);
00068 
00069 int sigaddset(sigset_t *set,
00070               int signum);
00071 
00072 int sigdelset(sigset_t *set,
00073               int signum);
00074 
00075 int sigismember(const sigset_t *set,
00076                 int signum);
00077 
00078 int pthread_kill(struct pse51_thread *thread,
00079                  int sig);
00080 
00081 int pthread_sigmask(int how,
00082                     const sigset_t *set,
00083                     sigset_t *oset);
00084 
00085 int sigaction(int sig,
00086               const struct sigaction *action,
00087               struct sigaction *old);
00088 
00089 int sigpending(sigset_t *set);
00090 
00091 int sigwait(const sigset_t *set,
00092             int *sig);
00093 
00094 /* Real-time signals. */
00095 int sigwaitinfo(const sigset_t *__restrict__ set,
00096                 siginfo_t *__restrict__ info);
00097 
00098 int sigtimedwait(const sigset_t *__restrict__ user_set,
00099                  siginfo_t *__restrict__ info,
00100                  const struct timespec *__restrict__ timeout);
00101 
00102 int pthread_sigqueue_np (struct pse51_thread *thread, int sig, union sigval value);
00103 
00104 #ifdef __cplusplus
00105 }
00106 #endif
00107 
00108 #else /* !(__KERNEL__ || __XENO_SIM__) */
00109 
00110 #include_next <signal.h>
00111 /* In case signal.h is included for a side effect of an __need* macro, include
00112    it a second time to get all definitions. */
00113 #include_next <signal.h>
00114 
00115 #endif /* !(__KERNEL__ || __XENO_SIM__) */
00116 
00117 /*
00118  * Those are pseudo-signals only available with pthread_kill() to
00119  * suspend/resume/unblock threads synchronously via the low-level
00120  * nucleus interface. Can't block them, queue them, or even set them
00121  * in a sigset. Those are nasty, strictly anti-POSIX things; we do
00122  * provide them nevertheless only because we are mean people doing
00123  * harmful code for no valid reason. Can't go against your nature,
00124  * right?  Nah... (this said, don't blame us for POSIX, we are not
00125  * _that_ mean).
00126  */
00127 #define SIGSUSP (SIGRTMAX + 1)
00128 #define SIGRESM (SIGRTMAX + 2)
00129 #define SIGRELS (SIGRTMAX + 3)
00130 
00131 #endif /* _XENO_POSIX_SIGNAL_H */

Generated on Wed Jan 23 2013 13:24:01 for Xenomai API by  doxygen 1.7.1