1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericopenlibs/openenvcore/include/signal.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,210 @@
1.4 +/*-
1.5 + * Copyright (c) 1991, 1993
1.6 + * The Regents of the University of California. All rights reserved.
1.7 + *
1.8 + * Redistribution and use in source and binary forms, with or without
1.9 + * modification, are permitted provided that the following conditions
1.10 + * are met:
1.11 + * 1. Redistributions of source code must retain the above copyright
1.12 + * notice, this list of conditions and the following disclaimer.
1.13 + * 2. Redistributions in binary form must reproduce the above copyright
1.14 + * notice, this list of conditions and the following disclaimer in the
1.15 + * documentation and/or other materials provided with the distribution.
1.16 + * 4. Neither the name of the University nor the names of its contributors
1.17 + * may be used to endorse or promote products derived from this software
1.18 + * without specific prior written permission.
1.19 + *
1.20 + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1.21 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1.22 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1.23 + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
1.24 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1.25 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1.26 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1.27 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
1.28 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
1.29 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
1.30 + * SUCH DAMAGE.
1.31 + *
1.32 + * Portions Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
1.33 + * @(#)signal.h 8.3 (Berkeley) 3/30/94
1.34 + * $FreeBSD: src/include/signal.h,v 1.24 2003/03/31 23:30:41 jeff Exp $
1.35 + */
1.36 +
1.37 +#ifndef _SIGNAL_H_
1.38 +#define _SIGNAL_H_
1.39 +
1.40 +#include <sys/cdefs.h>
1.41 +#include <sys/types.h>
1.42 +#include <sys/signal.h>
1.43 +
1.44 +__BEGIN_DECLS
1.45 +
1.46 +struct timespec;
1.47 +/* The following definitions have been taken from siglist.c file
1.48 + * Once signals are implemented then these definitions must be moved to that
1.49 + * file. (sys_signame,sys_siglist,sys_nsig) */
1.50 +
1.51 +static const char *const sys_signame[NSIG] = {
1.52 + "Signal 0",
1.53 + "hup", /* SIGHUP */
1.54 + "int", /* SIGINT */
1.55 + "quit", /* SIGQUIT */
1.56 + "ill", /* SIGILL */
1.57 + "trap", /* SIGTRAP */
1.58 + "abrt", /* SIGABRT */
1.59 + "emt", /* SIGEMT */
1.60 + "fpe", /* SIGFPE */
1.61 + "kill", /* SIGKILL */
1.62 + "bus", /* SIGBUS */
1.63 + "segv", /* SIGSEGV */
1.64 + "sys", /* SIGSYS */
1.65 + "pipe", /* SIGPIPE */
1.66 + "alrm", /* SIGALRM */
1.67 + "term", /* SIGTERM */
1.68 + "urg", /* SIGURG */
1.69 + "stop", /* SIGSTOP */
1.70 + "tstp", /* SIGTSTP */
1.71 + "cont", /* SIGCONT */
1.72 + "chld", /* SIGCHLD */
1.73 + "ttin", /* SIGTTIN */
1.74 + "ttou", /* SIGTTOU */
1.75 + "io", /* SIGIO */
1.76 + "xcpu", /* SIGXCPU */
1.77 + "xfsz", /* SIGXFSZ */
1.78 + "vtalrm", /* SIGVTALRM */
1.79 + "prof", /* SIGPROF */
1.80 + "winch", /* SIGWINCH */
1.81 + "info", /* SIGINFO */
1.82 + "usr1", /* SIGUSR1 */
1.83 + "usr2" /* SIGUSR2 */
1.84 +};
1.85 +
1.86 +static const char *const sys_siglist[NSIG] = {
1.87 + "Signal 0",
1.88 + "Hangup", /* SIGHUP */
1.89 + "Interrupt", /* SIGINT */
1.90 + "Quit", /* SIGQUIT */
1.91 + "Illegal instruction", /* SIGILL */
1.92 + "Trace/BPT trap", /* SIGTRAP */
1.93 + "Abort trap", /* SIGABRT */
1.94 + "EMT trap", /* SIGEMT */
1.95 + "Floating point exception", /* SIGFPE */
1.96 + "Killed", /* SIGKILL */
1.97 + "Bus error", /* SIGBUS */
1.98 + "Segmentation fault", /* SIGSEGV */
1.99 + "Bad system call", /* SIGSYS */
1.100 + "Broken pipe", /* SIGPIPE */
1.101 + "Alarm clock", /* SIGALRM */
1.102 + "Terminated", /* SIGTERM */
1.103 + "Urgent I/O condition", /* SIGURG */
1.104 + "Suspended (signal)", /* SIGSTOP */
1.105 + "Suspended", /* SIGTSTP */
1.106 + "Continued", /* SIGCONT */
1.107 + "Child exited", /* SIGCHLD */
1.108 + "Stopped (tty input)", /* SIGTTIN */
1.109 + "Stopped (tty output)", /* SIGTTOU */
1.110 + "I/O possible", /* SIGIO */
1.111 + "Cputime limit exceeded", /* SIGXCPU */
1.112 + "Filesize limit exceeded", /* SIGXFSZ */
1.113 + "Virtual timer expired", /* SIGVTALRM */
1.114 + "Profiling timer expired", /* SIGPROF */
1.115 + "Window size changes", /* SIGWINCH */
1.116 + "Information request", /* SIGINFO */
1.117 + "User defined signal 1", /* SIGUSR1 */
1.118 + "User defined signal 2" /* SIGUSR2 */
1.119 +};
1.120 +
1.121 +#if !defined (SIG_BLOCK)
1.122 + #define SIG_UNBLOCK 1
1.123 + #define SIG_BLOCK 2
1.124 + #define SIG_SETMASK 3
1.125 +#endif
1.126 +
1.127 +/* Type for data associated with a signal. */
1.128 +union sigval
1.129 +{
1.130 + int sival_int;
1.131 + void *sival_ptr;
1.132 +};
1.133 +
1.134 +typedef struct __siginfo_t
1.135 +{
1.136 + int si_signo;
1.137 + int si_code;
1.138 + int si_errno;
1.139 + pid_t si_pid;
1.140 + uid_t si_uid;
1.141 + void *si_addr;
1.142 + int si_status;
1.143 + long si_band;
1.144 + union sigval si_value;
1.145 +} siginfo_t;
1.146 +
1.147 +
1.148 +typedef struct sigevent
1.149 +{
1.150 + union sigval sigev_value;
1.151 + int sigev_signo;
1.152 + int sigev_notify;
1.153 +
1.154 + void (*sigev_notify_function) (union sigval); /* Function to start. */
1.155 + void *sigev_notify_attributes; /* Really pthread_attr_t. */
1.156 +} sigevent_t;
1.157 +
1.158 +/* `sigev_notify' values. */
1.159 +enum
1.160 +{
1.161 + SIGEV_SIGNAL = 0, /* Notify via signal. */
1.162 +# define SIGEV_SIGNAL SIGEV_SIGNAL
1.163 + SIGEV_NONE, /* Other notification: meaningless. */
1.164 +# define SIGEV_NONE SIGEV_NONE
1.165 + SIGEV_THREAD, /* Deliver via thread creation. */
1.166 +# define SIGEV_THREAD SIGEV_THREAD
1.167 +
1.168 + SIGEV_THREAD_ID = 4 /* Send signal to specific thread. */
1.169 +#define SIGEV_THREAD_ID SIGEV_THREAD_ID
1.170 +};
1.171 +
1.172 +static const int sys_nsig = sizeof(sys_siglist) / sizeof(sys_siglist[0]);
1.173 +
1.174 +IMPORT_C int sigaction(int sig, const struct sigaction *act, struct sigaction *oact);
1.175 +
1.176 +IMPORT_C int sigemptyset(sigset_t* set);
1.177 +
1.178 +#ifdef SYMBIAN_OE_POSIX_SIGNALS
1.179 +IMPORT_C int kill(pid_t pid, int sig);
1.180 +IMPORT_C int raise(int sig);
1.181 +IMPORT_C int sigqueue(pid_t pid, int sig, const union sigval value);
1.182 +
1.183 +IMPORT_C int sigfillset(sigset_t *set);
1.184 +IMPORT_C int sigaddset(sigset_t *set, int signo);
1.185 +IMPORT_C int sigdelset(sigset_t *set, int signo);
1.186 +IMPORT_C int sigismember(const sigset_t *set, int signo);
1.187 +IMPORT_C int sigandset(sigset_t * set, const sigset_t * left, const sigset_t * right);
1.188 +IMPORT_C int sigorset(sigset_t * set, const sigset_t * left, const sigset_t * right);
1.189 +IMPORT_C int sigisemptyset(const sigset_t * set);
1.190 +
1.191 +IMPORT_C int sigprocmask(int how, const sigset_t* set,sigset_t* oset);
1.192 +IMPORT_C int sighold(int signo);
1.193 +IMPORT_C int sigrelse(int signo);
1.194 +IMPORT_C int sigpause(int signo);
1.195 +
1.196 +IMPORT_C int sigwait(const sigset_t *set, int *sig);
1.197 +IMPORT_C int sigtimedwait(const sigset_t *set, siginfo_t *info,
1.198 + const struct timespec *timeout);
1.199 +IMPORT_C int sigwaitinfo(const sigset_t *set, siginfo_t *info);
1.200 +
1.201 +IMPORT_C void (*bsd_signal(int, void (*)(int)))(int);
1.202 +IMPORT_C void (*sigset(int, void (*)(int)))(int);
1.203 +IMPORT_C void (*signal(int, void (*)(int)))(int);
1.204 +IMPORT_C int sigpending(sigset_t *set);
1.205 +IMPORT_C int sigignore(int sig);
1.206 +IMPORT_C void psignal(int sig, const char *s);
1.207 +
1.208 +IMPORT_C int sigenable();
1.209 +
1.210 +#endif
1.211 +__END_DECLS
1.212 +
1.213 +#endif /* !_SIGNAL_H_ */