linux_siginfo.h revision 1.3
1/*	$NetBSD: linux_siginfo.h,v 1.3 1999/01/03 05:34:39 erh Exp $	*/
2
3/*-
4 * Copyright (c) 1998 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Eric Haszlakiewicz.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 *    notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 *    notice, this list of conditions and the following disclaimer in the
17 *    documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 *    must display the following acknowledgement:
20 *	This product includes software developed by the NetBSD
21 *	Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 *    contributors may be used to endorse or promote products derived
24 *    from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39#ifndef _ALPHA_LINUX_SIGINFO_H
40#define _ALPHA_LINUX_SIGINFO_H
41
42typedef union linux_sigval {
43	int	sival_int;
44	void	*sival_ptr;
45} linux_sigval_t;
46
47#define SI_MAX_SIZE	128
48#define SI_PAD_SIZE	((SI_MAX_SIZE/sizeof(int)) - 4)
49
50typedef struct linux_siginfo {
51	int	lsi_signo;
52	int	lsi_errno;
53	int	lsi_code;
54	union {
55		int _pad[SI_PAD_SIZE];
56
57		/* kill() */
58		struct {
59			linux_pid_t	_pid;
60			linux_uid_t	_uid;
61		} _kill;
62
63		/* POSIX.1b signals */
64		struct {
65			linux_pid_t	_pid;
66			linux_uid_t	_uid;
67			linux_sigval_t	_sigval;
68		} _rt;
69
70		/* POSIX.1b timers */
71		struct {
72			unsigned int	_timer1;
73			unsigned int	_timer2;
74		} _timer;
75
76		/* SIGCHLD */
77		struct {
78			linux_pid_t	_pid;
79			int		_status;
80			linux_clock_t	_utime;
81			linux_clock_t	_stime;
82		} _sigchld;
83
84		/* SIGPOLL */
85		struct {
86			int _band;
87			int _fd;
88		} _sigpoll;
89
90		/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
91		struct {
92			void *_addr;
93		} _sigfault;
94	} _sidata;
95} linux_siginfo_t;
96
97#define lsi_pid		_sidata._kill._pid
98#define lsi_uid		_sidata._kill._uid
99
100#define LINUX_SI_USER		0
101#define	LINUX_SI_KERNEL		0x80
102#define LINUX_SI_QUEUE		-1
103#define LINUX_SI_TIMER		-2
104#define LINUX_SI_MESGQ		-3
105#define LINUX_SI_ASYNCIO	-4
106
107#define LINUX_SI_FROMUSER(sp)	((sp)->si_code <= 0)
108#define LINUX_SI_FROMKERENL(sp)	((sp)->si_code > 0)
109
110
111#endif /* !_ALPHA_LINUX_SIGINFO_H */
112