os/ossrv/genericopenlibs/openenvcore/include/sys/signal.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*-
sl@0
     2
 * Copyright (c) 1982, 1986, 1989, 1991, 1993
sl@0
     3
 *	The Regents of the University of California.  All rights reserved.
sl@0
     4
 * (c) UNIX System Laboratories, Inc.
sl@0
     5
 * All or some portions of this file are derived from material licensed
sl@0
     6
 * to the University of California by American Telephone and Telegraph
sl@0
     7
 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
sl@0
     8
 * the permission of UNIX System Laboratories, Inc.
sl@0
     9
 *
sl@0
    10
 * Redistribution and use in source and binary forms, with or without
sl@0
    11
 * modification, are permitted provided that the following conditions
sl@0
    12
 * are met:
sl@0
    13
 * 1. Redistributions of source code must retain the above copyright
sl@0
    14
 *    notice, this list of conditions and the following disclaimer.
sl@0
    15
 * 2. Redistributions in binary form must reproduce the above copyright
sl@0
    16
 *    notice, this list of conditions and the following disclaimer in the
sl@0
    17
 *    documentation and/or other materials provided with the distribution.
sl@0
    18
 * 4. Neither the name of the University nor the names of its contributors
sl@0
    19
 *    may be used to endorse or promote products derived from this software
sl@0
    20
 *    without specific prior written permission.
sl@0
    21
 *
sl@0
    22
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
sl@0
    23
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
sl@0
    24
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
sl@0
    25
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
sl@0
    26
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
sl@0
    27
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
sl@0
    28
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
sl@0
    29
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
sl@0
    30
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
sl@0
    31
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
sl@0
    32
 * SUCH DAMAGE.
sl@0
    33
 *
sl@0
    34
 *	@(#)signal.h	8.4 (Berkeley) 5/4/95
sl@0
    35
 * $FreeBSD: src/sys/sys/signal.h,v 1.45 2004/06/11 11:43:46 phk Exp $
sl@0
    36
 */
sl@0
    37
sl@0
    38
#ifndef _SYS_SIGNAL_H_
sl@0
    39
#define	_SYS_SIGNAL_H_
sl@0
    40
sl@0
    41
#include <sys/cdefs.h>
sl@0
    42
#include <sys/_types.h>
sl@0
    43
#include <sys/_sigset.h>
sl@0
    44
sl@0
    45
#include <stdapis/machine/signal.h>	/* sig_atomic_t; trap codes; sigcontext */
sl@0
    46
sl@0
    47
/*
sl@0
    48
 * System defined signals.
sl@0
    49
 */
sl@0
    50
#define	SIGHUP		1	/* hangup */
sl@0
    51
#define	SIGINT		2	/* interrupt */
sl@0
    52
#define	SIGQUIT		3	/* quit */
sl@0
    53
#define	SIGILL		4	/* illegal instr. (not reset when caught) */
sl@0
    54
#define	SIGTRAP		5	/* trace trap (not reset when caught) */
sl@0
    55
#define	SIGABRT		6	/* abort() */
sl@0
    56
#define	SIGIOT		SIGABRT	/* compatibility */
sl@0
    57
#define	SIGEMT		7	/* EMT instruction */
sl@0
    58
#define	SIGFPE		8	/* floating point exception */
sl@0
    59
#define	SIGKILL		9	/* kill (cannot be caught or ignored) */
sl@0
    60
#define	SIGBUS		10	/* bus error */
sl@0
    61
#define	SIGSEGV		11	/* segmentation violation */
sl@0
    62
#define	SIGSYS		12	/* non-existent system call invoked */
sl@0
    63
#define	SIGPIPE		13	/* write on a pipe with no one to read it */
sl@0
    64
#define	SIGALRM		14	/* alarm clock */
sl@0
    65
#define	SIGTERM		15	/* software termination signal from kill */
sl@0
    66
#define	SIGURG		16	/* urgent condition on IO channel */
sl@0
    67
#define	SIGSTOP		17	/* sendable stop signal not from tty */
sl@0
    68
#define	SIGTSTP		18	/* stop signal from tty */
sl@0
    69
#define	SIGCONT		19	/* continue a stopped process */
sl@0
    70
#define	SIGCHLD		20	/* to parent on child stop or exit */
sl@0
    71
#define	SIGTTIN		21	/* to readers pgrp upon background tty read */
sl@0
    72
#define	SIGTTOU		22	/* like TTIN if (tp->t_local&LTOSTOP) */
sl@0
    73
#define	SIGIO		23	/* input/output possible signal */
sl@0
    74
#define	SIGXCPU		24	/* exceeded CPU time limit */
sl@0
    75
#define	SIGXFSZ		25	/* exceeded file size limit */
sl@0
    76
#define	SIGVTALRM	26	/* virtual time alarm */
sl@0
    77
#define	SIGPROF		27	/* profiling time alarm */
sl@0
    78
#define	SIGWINCH	28	/* window size changes */
sl@0
    79
#define	SIGINFO		29	/* information request */
sl@0
    80
#define	SIGUSR1		30	/* user defined signal 1 */
sl@0
    81
#define	SIGUSR2		31	/* user defined signal 2 */
sl@0
    82
#define	SIGTHR		32	/* Thread interrupt. */
sl@0
    83
sl@0
    84
#define SIGRTMIN	33
sl@0
    85
#define SIGRTMAX	64
sl@0
    86
/*
sl@0
    87
 * XXX missing SIGRTMIN, SIGRTMAX.
sl@0
    88
 */
sl@0
    89
sl@0
    90
#define	SIG_DFL		((__sighandler_t *)0)
sl@0
    91
#define	SIG_IGN		((__sighandler_t *)1)
sl@0
    92
#define	SIG_ERR		((__sighandler_t *)-1)
sl@0
    93
#define	SIG_HOLD	((__sighandler_t *)3)
sl@0
    94
sl@0
    95
sl@0
    96
/*
sl@0
    97
 * XXX missing SIG_HOLD.
sl@0
    98
 */
sl@0
    99
sl@0
   100
/*-
sl@0
   101
 * Type of a signal handling function.
sl@0
   102
 *
sl@0
   103
 * Language spec sez signal handlers take exactly one arg, even though we
sl@0
   104
 * actually supply three.  Ugh!
sl@0
   105
 *
sl@0
   106
 * We don't try to hide the difference by leaving out the args because
sl@0
   107
 * that would cause warnings about conformant programs.  Nonconformant
sl@0
   108
 * programs can avoid the warnings by casting to (__sighandler_t *) or
sl@0
   109
 * sig_t before calling signal() or assigning to sa_handler or sv_handler.
sl@0
   110
 *
sl@0
   111
 * The kernel should reverse the cast before calling the function.  It
sl@0
   112
 * has no way to do this, but on most machines 1-arg and 3-arg functions
sl@0
   113
 * have the same calling protocol so there is no problem in practice.
sl@0
   114
 * A bit in sa_flags could be used to specify the number of args.
sl@0
   115
 */
sl@0
   116
typedef	void __sighandler_t(int);
sl@0
   117
sl@0
   118
#ifndef _SIGSET_T_DECLARED
sl@0
   119
#define	_SIGSET_T_DECLARED
sl@0
   120
typedef	__uint64_t sigset_t;
sl@0
   121
#endif
sl@0
   122
sl@0
   123
#if __POSIX_VISIBLE || __XSI_VISIBLE
sl@0
   124
struct __siginfo_t;
sl@0
   125
sl@0
   126
/*
sl@0
   127
 * Signal vector "template" used in sigaction call.
sl@0
   128
 */
sl@0
   129
struct sigaction {
sl@0
   130
	union {
sl@0
   131
		void    (*_sa_handler)(int);
sl@0
   132
		void    (*_sa_sigaction)(int, struct __siginfo_t*, void *);
sl@0
   133
	} _sa_u;		/* signal handler */
sl@0
   134
	int	sa_flags;		/* see signal options below */
sl@0
   135
	sigset_t sa_mask;		/* signal mask to apply */
sl@0
   136
};
sl@0
   137
sl@0
   138
#define	sa_handler		_sa_u._sa_handler
sl@0
   139
#define sa_sigaction 	_sa_u._sa_sigaction
sl@0
   140
sl@0
   141
#endif
sl@0
   142
sl@0
   143
#if __POSIX_VISIBLE || __XSI_VISIBLE
sl@0
   144
#define	SA_NOCLDSTOP	0x0008	/* do not generate SIGCHLD on child stop */
sl@0
   145
#endif /* __POSIX_VISIBLE || __XSI_VISIBLE */
sl@0
   146
sl@0
   147
#if __XSI_VISIBLE
sl@0
   148
#define	SA_ONSTACK	0x0001	/* take signal on signal stack */
sl@0
   149
#define	SA_RESTART	0x0002	/* restart system call on signal return */
sl@0
   150
#define	SA_RESETHAND	0x0004	/* reset to SIG_DFL when taking signal */
sl@0
   151
#define	SA_NODEFER	0x0010	/* don't mask the signal we're delivering */
sl@0
   152
#define	SA_NOCLDWAIT	0x0020	/* don't keep zombies around */
sl@0
   153
#define	SA_SIGINFO	0x0040	/* signal handler with SA_SIGINFO args */
sl@0
   154
#endif
sl@0
   155
sl@0
   156
#if __BSD_VISIBLE
sl@0
   157
#define	NSIG		32	/* number of old signals (counting 0) */
sl@0
   158
#endif
sl@0
   159
sl@0
   160
#endif /* !_SYS_SIGNAL_H_ */