2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 4. Neither the name of the University nor the names of its contributors
14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * Portions Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
30 * @(#)signal.h 8.3 (Berkeley) 3/30/94
31 * $FreeBSD: src/include/signal.h,v 1.24 2003/03/31 23:30:41 jeff Exp $
37 #include <sys/cdefs.h>
38 #include <sys/types.h>
39 #include <sys/signal.h>
44 /* The following definitions have been taken from siglist.c file
45 * Once signals are implemented then these definitions must be moved to that
46 * file. (sys_signame,sys_siglist,sys_nsig) */
48 static const char *const sys_signame[NSIG] = {
75 "vtalrm", /* SIGVTALRM */
77 "winch", /* SIGWINCH */
83 static const char *const sys_siglist[NSIG] = {
85 "Hangup", /* SIGHUP */
86 "Interrupt", /* SIGINT */
88 "Illegal instruction", /* SIGILL */
89 "Trace/BPT trap", /* SIGTRAP */
90 "Abort trap", /* SIGABRT */
91 "EMT trap", /* SIGEMT */
92 "Floating point exception", /* SIGFPE */
93 "Killed", /* SIGKILL */
94 "Bus error", /* SIGBUS */
95 "Segmentation fault", /* SIGSEGV */
96 "Bad system call", /* SIGSYS */
97 "Broken pipe", /* SIGPIPE */
98 "Alarm clock", /* SIGALRM */
99 "Terminated", /* SIGTERM */
100 "Urgent I/O condition", /* SIGURG */
101 "Suspended (signal)", /* SIGSTOP */
102 "Suspended", /* SIGTSTP */
103 "Continued", /* SIGCONT */
104 "Child exited", /* SIGCHLD */
105 "Stopped (tty input)", /* SIGTTIN */
106 "Stopped (tty output)", /* SIGTTOU */
107 "I/O possible", /* SIGIO */
108 "Cputime limit exceeded", /* SIGXCPU */
109 "Filesize limit exceeded", /* SIGXFSZ */
110 "Virtual timer expired", /* SIGVTALRM */
111 "Profiling timer expired", /* SIGPROF */
112 "Window size changes", /* SIGWINCH */
113 "Information request", /* SIGINFO */
114 "User defined signal 1", /* SIGUSR1 */
115 "User defined signal 2" /* SIGUSR2 */
118 #if !defined (SIG_BLOCK)
119 #define SIG_UNBLOCK 1
121 #define SIG_SETMASK 3
124 /* Type for data associated with a signal. */
131 typedef struct __siginfo_t
141 union sigval si_value;
145 typedef struct sigevent
147 union sigval sigev_value;
151 void (*sigev_notify_function) (union sigval); /* Function to start. */
152 void *sigev_notify_attributes; /* Really pthread_attr_t. */
155 /* `sigev_notify' values. */
158 SIGEV_SIGNAL = 0, /* Notify via signal. */
159 # define SIGEV_SIGNAL SIGEV_SIGNAL
160 SIGEV_NONE, /* Other notification: meaningless. */
161 # define SIGEV_NONE SIGEV_NONE
162 SIGEV_THREAD, /* Deliver via thread creation. */
163 # define SIGEV_THREAD SIGEV_THREAD
165 SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */
166 #define SIGEV_THREAD_ID SIGEV_THREAD_ID
169 static const int sys_nsig = sizeof(sys_siglist) / sizeof(sys_siglist[0]);
171 IMPORT_C int sigaction(int sig, const struct sigaction *act, struct sigaction *oact);
173 IMPORT_C int sigemptyset(sigset_t* set);
175 #ifdef SYMBIAN_OE_POSIX_SIGNALS
176 IMPORT_C int kill(pid_t pid, int sig);
177 IMPORT_C int raise(int sig);
178 IMPORT_C int sigqueue(pid_t pid, int sig, const union sigval value);
180 IMPORT_C int sigfillset(sigset_t *set);
181 IMPORT_C int sigaddset(sigset_t *set, int signo);
182 IMPORT_C int sigdelset(sigset_t *set, int signo);
183 IMPORT_C int sigismember(const sigset_t *set, int signo);
184 IMPORT_C int sigandset(sigset_t * set, const sigset_t * left, const sigset_t * right);
185 IMPORT_C int sigorset(sigset_t * set, const sigset_t * left, const sigset_t * right);
186 IMPORT_C int sigisemptyset(const sigset_t * set);
188 IMPORT_C int sigprocmask(int how, const sigset_t* set,sigset_t* oset);
189 IMPORT_C int sighold(int signo);
190 IMPORT_C int sigrelse(int signo);
191 IMPORT_C int sigpause(int signo);
193 IMPORT_C int sigwait(const sigset_t *set, int *sig);
194 IMPORT_C int sigtimedwait(const sigset_t *set, siginfo_t *info,
195 const struct timespec *timeout);
196 IMPORT_C int sigwaitinfo(const sigset_t *set, siginfo_t *info);
198 IMPORT_C void (*bsd_signal(int, void (*)(int)))(int);
199 IMPORT_C void (*sigset(int, void (*)(int)))(int);
200 IMPORT_C void (*signal(int, void (*)(int)))(int);
201 IMPORT_C int sigpending(sigset_t *set);
202 IMPORT_C int sigignore(int sig);
203 IMPORT_C void psignal(int sig, const char *s);
205 IMPORT_C int sigenable();
210 #endif /* !_SIGNAL_H_ */