diff options
Diffstat (limited to 'libc/sysdeps/linux/sh/bits/siginfo.h')
-rw-r--r-- | libc/sysdeps/linux/sh/bits/siginfo.h | 71 |
1 files changed, 49 insertions, 22 deletions
diff --git a/libc/sysdeps/linux/sh/bits/siginfo.h b/libc/sysdeps/linux/sh/bits/siginfo.h index 66e626199..70a8c217e 100644 --- a/libc/sysdeps/linux/sh/bits/siginfo.h +++ b/libc/sysdeps/linux/sh/bits/siginfo.h @@ -1,29 +1,33 @@ -/* siginfo_t, sigevent and constants. Linux version. - Copyright (C) 1997, 1998 Free Software Foundation, Inc. +/* siginfo_t, sigevent and constants. Linux/SPARC version. + Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Lesser General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ -#if !defined _SIGNAL_H && !defined __need_siginfo_t +#if !defined _SIGNAL_H && !defined __need_siginfo_t \ + && !defined __need_sigevent_t # error "Never include this file directly. Use <signal.h> instead" #endif -#if (!defined __have_siginfo_t \ - && (defined _SIGNAL_H || defined __need_siginfo_t)) -# define __have_siginfo_t 1 +#include <bits/wordsize.h> + +#if (!defined __have_sigval_t \ + && (defined _SIGNAL_H || defined __need_siginfo_t \ + || defined __need_sigevent_t)) +# define __have_sigval_t 1 /* Type for data associated with a signal. */ typedef union sigval @@ -31,9 +35,18 @@ typedef union sigval int sival_int; void *sival_ptr; } sigval_t; +#endif + +#if (!defined __have_siginfo_t \ + && (defined _SIGNAL_H || defined __need_siginfo_t)) +# define __have_siginfo_t 1 # define __SI_MAX_SIZE 128 -# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3) +# if __WORDSIZE == 64 +# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4) +# else +# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3) +# endif typedef struct siginfo { @@ -87,7 +100,7 @@ typedef struct siginfo /* SIGPOLL. */ struct { - int si_band; /* Band event for SIGPOLL. */ + long int si_band; /* Band event for SIGPOLL. */ int si_fd; } _sigpoll; } _sifields; @@ -97,6 +110,8 @@ typedef struct siginfo /* X/Open requires some more fields with fixed names. */ # define si_pid _sifields._kill.si_pid # define si_uid _sifields._kill.si_uid +# define si_timer1 _sifields._timer._timer1 +# define si_timer2 _sifields._timer._timer2 # define si_status _sifields._sigchld.si_status # define si_utime _sifields._sigchld.si_utime # define si_stime _sifields._sigchld.si_stime @@ -112,7 +127,9 @@ typedef struct siginfo signals. */ enum { - SI_SIGIO = -5, /* Sent by queued SIGIO. */ + SI_ASYNCNL = -6, /* Sent by asynch name lookup completion. */ +# define SI_ASYNCNL SI_ASYNCNL + SI_SIGIO, /* Sent by queued SIGIO. */ # define SI_SIGIO SI_SIGIO SI_ASYNCIO, /* Sent by AIO completion. */ # define SI_ASYNCIO SI_ASYNCIO @@ -122,8 +139,10 @@ enum # define SI_TIMER SI_TIMER SI_QUEUE, /* Sent by sigqueue. */ # define SI_QUEUE SI_QUEUE - SI_USER /* Sent by kill, sigsend, raise. */ + SI_USER, /* Sent by kill, sigsend, raise. */ # define SI_USER SI_USER + SI_KERNEL = 0x80 /* Send by kernel. */ +#define SI_KERNEL SI_KERNEL }; @@ -236,12 +255,20 @@ enum #endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */ -#if defined _SIGNAL_H && !defined __have_sigevent_t +#if (defined _SIGNAL_H || defined __need_sigevent_t) \ + && !defined __have_sigevent_t # define __have_sigevent_t 1 /* Structure to transport application-defined values with signals. */ # define __SIGEV_MAX_SIZE 64 -# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3) +# if __WORDSIZE == 64 +# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4) +# else +# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3) +# endif + +/* Forward declaration of the `pthread_attr_t' type. */ +struct __pthread_attr_s; typedef struct sigevent { @@ -255,8 +282,8 @@ typedef struct sigevent struct { - void (*_function) __PMT ((sigval_t)); /* Function to start. */ - void *_attribute; /* Really pthread_attr_t. */ + void (*_function) (sigval_t); /* Function to start. */ + struct __pthread_attr_s *_attribute; /* Really pthread_attr_t. */ } _sigev_thread; } _sigev_un; } sigevent_t; |