2002-07-24 Jeff Johnston <jjohnstn@redhat.com>

* libc/include/signal.h (SIG_IGN, SIG_DFL, SIG_ERR): Change
        to use _sig_func_ptr type casted constants.
        (_sig_func_ptr): Typedef moved to sys/signal.h.
        * libc/include/sys/signal.h (_sig_func_ptr): Typedef added.
        For __rtems, use POSIX definition, otherwise default to ANSI.
        * libc/sys/linux/sys/signal.h (_sig_func_ptr): Typedef added.
This commit is contained in:
Jeff Johnston 2002-07-24 18:18:07 +00:00
parent a703e0f2ee
commit 9cef8ef52b
4 changed files with 20 additions and 14 deletions

View File

@ -1,3 +1,12 @@
2002-07-24 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/signal.h (SIG_IGN, SIG_DFL, SIG_ERR): Change
to use _sig_func_ptr type casted constants.
(_sig_func_ptr): Typedef moved to sys/signal.h.
* libc/include/sys/signal.h (_sig_func_ptr): Typedef added.
For __rtems, use POSIX definition, otherwise default to ANSI.
* libc/sys/linux/sys/signal.h (_sig_func_ptr): Typedef added.
2002-07-24 Stephane Carrez <stcarrez@nerim.fr> 2002-07-24 Stephane Carrez <stcarrez@nerim.fr>
* configure.host: Recognize m6811-elf and m6812-elf targets. * configure.host: Recognize m6811-elf and m6812-elf targets.

View File

@ -8,17 +8,9 @@ _BEGIN_STD_C
typedef int sig_atomic_t; /* Atomic entity type (ANSI) */ typedef int sig_atomic_t; /* Atomic entity type (ANSI) */
#if defined(__STDC__) || defined(__cplusplus) #define SIG_DFL ((_sig_func_ptr)0) /* Default action */
#define SIG_DFL ((void (*)(int))0) /* Default action */ #define SIG_IGN ((_sig_func_ptr)1) /* Ignore action */
#define SIG_IGN ((void (*)(int))1) /* Ignore action */ #define SIG_ERR ((_sig_func_ptr)-1) /* Error return */
#define SIG_ERR ((void (*)(int))-1) /* Error return */
#else
#define SIG_DFL ((void (*)())0) /* Default action */
#define SIG_IGN ((void (*)())1) /* Ignore action */
#define SIG_ERR ((void (*)())-1) /* Error return */
#endif
typedef void (*_sig_func_ptr) (int);
struct _reent; struct _reent;

View File

@ -84,13 +84,15 @@ typedef struct {
* application should not use both simultaneously. * application should not use both simultaneously.
*/ */
typedef void (*_sig_func_ptr)();
struct sigaction { struct sigaction {
int sa_flags; /* Special flags to affect behavior of signal */ int sa_flags; /* Special flags to affect behavior of signal */
sigset_t sa_mask; /* Additional set of signals to be blocked */ sigset_t sa_mask; /* Additional set of signals to be blocked */
/* during execution of signal-catching */ /* during execution of signal-catching */
/* function. */ /* function. */
union { union {
void (*_handler)(); /* SIG_DFL, SIG_IGN, or pointer to a function */ _sig_func_ptr _handler; /* SIG_DFL, SIG_IGN, or pointer to a function */
#if defined(_POSIX_REALTIME_SIGNALS) #if defined(_POSIX_REALTIME_SIGNALS)
void (*_sigaction)( int, siginfo_t *, void * ); void (*_sigaction)( int, siginfo_t *, void * );
#endif #endif
@ -104,9 +106,11 @@ struct sigaction {
#else #else
typedef void (*_sig_func_ptr)(int);
struct sigaction struct sigaction
{ {
void (*sa_handler)(int); _sig_func_ptr sa_handler;
sigset_t sa_mask; sigset_t sa_mask;
int sa_flags; int sa_flags;
}; };

View File

@ -19,7 +19,8 @@
#undef sigset_t #undef sigset_t
#define sigset_t __sigset_t #define sigset_t __sigset_t
typedef void (*__sighandler_t) (int); typedef void (*_sig_func_ptr) (int);
typedef _sig_func_ptr __sighandler_t;
#include <bits/siginfo.h> #include <bits/siginfo.h>
#include <bits/sigaction.h> #include <bits/sigaction.h>