jehanne: fix signal headers

This commit is contained in:
Giacomo Tesio 2017-09-14 00:06:29 +02:00
parent b891b3c8da
commit ed05094c78
2 changed files with 9 additions and 55 deletions

View File

@ -1,8 +1,6 @@
#ifndef _SIGNAL_H_ #ifndef _SIGNAL_H_
#define _SIGNAL_H_ #define _SIGNAL_H_
#define GIACOMO
#include "_ansi.h" #include "_ansi.h"
#include <sys/cdefs.h> #include <sys/cdefs.h>
#include <sys/signal.h> #include <sys/signal.h>
@ -11,26 +9,21 @@ _BEGIN_STD_C
typedef int sig_atomic_t; /* Atomic entity type (ANSI) */ typedef int sig_atomic_t; /* Atomic entity type (ANSI) */
#if __BSD_VISIBLE #if __BSD_VISIBLE
typedef _sig_func_ptr sig_t; /* BSD naming */ typedef PosixSigHandler sig_t; /* BSD naming */
#endif #endif
#if __GNU_VISIBLE #if __GNU_VISIBLE
typedef _sig_func_ptr sighandler_t; /* glibc naming */ typedef PosixSigHandler sighandler_t; /* glibc naming */
#endif #endif
#define SIG_DFL ((_sig_func_ptr)0) /* Default action */ #define SIG_DFL ((PosixSigHandler)0) /* Default action */
#define SIG_IGN ((_sig_func_ptr)1) /* Ignore action */ #define SIG_IGN ((PosixSigHandler)1) /* Ignore action */
#define SIG_ERR ((_sig_func_ptr)-1) /* Error return */ #define SIG_ERR ((PosixSigHandler)-1) /* Error return */
struct _reent; struct _reent;
_sig_func_ptr _EXFUN(_signal_r, (struct _reent *, int, _sig_func_ptr)); PosixSigHandler signal(int signo, PosixSigHandler handler);
int _EXFUN(_raise_r, (struct _reent *, int)); int raise(int signo);
void psignal(int signo, const char *s);
#ifndef _REENT_ONLY
_sig_func_ptr _EXFUN(signal, (int, _sig_func_ptr));
int _EXFUN(raise, (int));
void _EXFUN(psignal, (int, const char *));
#endif
_END_STD_C _END_STD_C

View File

@ -50,24 +50,6 @@ typedef PosixSignalMask sigset_t;
#define SIGEV_THREAD 3 /* A notification function shall be called to */ #define SIGEV_THREAD 3 /* A notification function shall be called to */
/* perform notification. */ /* perform notification. */
/* Signal Generation and Delivery, P1003.1b-1993, p. 63
NOTE: P1003.1c/D10, p. 34 adds sigev_notify_function and
sigev_notify_attributes to the sigevent structure. */
union sigval {
int sival_int; /* Integer signal value */
void *sival_ptr; /* Pointer signal value */
};
struct sigevent {
int sigev_notify; /* Notification type */
int sigev_signo; /* Signal number */
union sigval sigev_value; /* Signal value */
void (*sigev_notify_function)( union sigval );
/* Notification function */
pthread_attr_t *sigev_notify_attributes; /* Notification Attributes */
};
/* Signal Actions, P1003.1b-1993, p. 64 */ /* Signal Actions, P1003.1b-1993, p. 64 */
/* si_code values, p. 66 */ /* si_code values, p. 66 */
@ -77,7 +59,7 @@ struct sigevent {
#define SI_ASYNCIO 4 /* Indicates completion of asycnhronous IO */ #define SI_ASYNCIO 4 /* Indicates completion of asycnhronous IO */
#define SI_MESGQ 5 /* Indicates arrival of a message at an empty queue */ #define SI_MESGQ 5 /* Indicates arrival of a message at an empty queue */
#define siginfo_t PosixSignalInfo; #define siginfo_t PosixSignalInfo
/* 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 */ /* 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 */
@ -88,27 +70,6 @@ struct sigevent {
#define SA_ONSTACK 4 /* Signal delivery will be on a separate stack. */ #define SA_ONSTACK 4 /* Signal delivery will be on a separate stack. */
#endif #endif
/* struct sigaction notes from POSIX:
*
* (1) Routines stored in sa_handler should take a single int as
* their argument although the POSIX standard does not require this.
* This is not longer true since at least POSIX.1-2008
* (2) The fields sa_handler and sa_sigaction may overlap, and a conforming
* application should not use both simultaneously.
*/
struct sigaction {
int sa_flags; /* Special flags to affect behavior of signal */
sigset_t sa_mask; /* Additional set of signals to be blocked */
/* during execution of signal-catching */
/* function. */
union {
_sig_func_ptr _handler; /* SIG_DFL, SIG_IGN, or pointer to a function */
_sig_act_ptr _sigaction;
} _signal_handlers;
};
#define sa_handler _signal_handlers._handler
#define sa_sigaction _signal_handlers._sigaction
#if __BSD_VISIBLE || __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809 #if __BSD_VISIBLE || __XSI_VISIBLE >= 4 || __POSIX_VISIBLE >= 200809
/* /*