* signal.c (ruby_sigaction_t): added.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
079505c040
commit
550f10ca5b
12
signal.c
12
signal.c
@ -408,6 +408,13 @@ static struct {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef RETSIGTYPE (*sighandler_t)(int);
|
typedef RETSIGTYPE (*sighandler_t)(int);
|
||||||
|
#ifdef SA_SIGINFO
|
||||||
|
typedef void ruby_sigaction_t(int, siginfo_t*, void*);
|
||||||
|
#define SIGINFO_ARG , siginfo_t *info, void *ctx
|
||||||
|
#else
|
||||||
|
typedef RETSIGTYPE ruby_sigaction_t(int);
|
||||||
|
#define SIGINFO_ARG
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef POSIX_SIGNAL
|
#ifdef POSIX_SIGNAL
|
||||||
#if defined(SIGSEGV) && defined(HAVE_SIGALTSTACK)
|
#if defined(SIGSEGV) && defined(HAVE_SIGALTSTACK)
|
||||||
@ -415,7 +422,6 @@ typedef RETSIGTYPE (*sighandler_t)(int);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_SIGALTSTACK
|
#ifdef USE_SIGALTSTACK
|
||||||
#define SIGINFO_ARG , siginfo_t *info, void *ctx
|
|
||||||
#ifdef SIGSTKSZ
|
#ifdef SIGSTKSZ
|
||||||
#define ALT_STACK_SIZE (SIGSTKSZ*2)
|
#define ALT_STACK_SIZE (SIGSTKSZ*2)
|
||||||
#else
|
#else
|
||||||
@ -442,8 +448,6 @@ register_sigaltstack()
|
|||||||
rb_bug("register_sigaltstack. error\n");
|
rb_bug("register_sigaltstack. error\n");
|
||||||
is_altstack_defined = 1;
|
is_altstack_defined = 1;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#define SIGINFO_ARG
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static sighandler_t
|
static sighandler_t
|
||||||
@ -457,7 +461,7 @@ ruby_signal(int signum, sighandler_t handler)
|
|||||||
|
|
||||||
sigemptyset(&sigact.sa_mask);
|
sigemptyset(&sigact.sa_mask);
|
||||||
#ifdef SA_SIGINFO
|
#ifdef SA_SIGINFO
|
||||||
sigact.sa_sigaction = (void (*)(int, siginfo_t*, void*))handler;
|
sigact.sa_sigaction = (ruby_sigaction_t*)handler;
|
||||||
sigact.sa_flags = SA_SIGINFO;
|
sigact.sa_flags = SA_SIGINFO;
|
||||||
#else
|
#else
|
||||||
sigact.sa_handler = handler;
|
sigact.sa_handler = handler;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user