This is the last part of siginfo support for pc532. Simon will make this
work.
This commit is contained in:
parent
368d3f3d0e
commit
e0406466be
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: __sigaction14_sigtramp.c,v 1.1 2002/07/09 23:32:37 thorpej Exp $ */
|
||||
/* $NetBSD: __sigaction14_sigtramp.c,v 1.2 2003/11/06 02:46:44 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2002 The NetBSD Foundation, Inc.
|
||||
|
@ -36,23 +36,43 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#define __LIBC12_SOURCE__
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stddef.h>
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "extern.h"
|
||||
|
||||
__weak_alias(__sigaction14, __libc_sigaction14)
|
||||
|
||||
int
|
||||
__sigaction14(int sig, const struct sigaction *act, struct sigaction *oact)
|
||||
__libc_sigaction14(int sig, const struct sigaction *act, struct sigaction *oact)
|
||||
{
|
||||
extern int __sigtramp_sigcontext_1[];
|
||||
extern const int __sigtramp_sigcontext_1[];
|
||||
extern const int __sigtramp_siginfo_2[];
|
||||
int rv;
|
||||
|
||||
/*
|
||||
* Right here we should select the SA_SIGINFO trampoline
|
||||
* if SA_SIGINFO is set in the sigaction.
|
||||
* If no sigaction, use the "default" trampoline since it won't
|
||||
* be used.
|
||||
*/
|
||||
if (act == NULL)
|
||||
return __sigaction_sigtramp(sig, act, oact, NULL, 0);
|
||||
|
||||
return (__sigaction_sigtramp(sig, act, oact,
|
||||
__sigtramp_sigcontext_1, 1));
|
||||
/*
|
||||
* We select the non-SA_SIGINFO trampoline if SA_SIGINFO is not
|
||||
* set in the sigaction.
|
||||
*/
|
||||
if ((act->sa_flags & SA_SIGINFO) == 0) {
|
||||
rv = __sigaction_sigtramp(sig, act, oact,
|
||||
__sigtramp_sigcontext_1, 1);
|
||||
if (rv >= 0 || errno != EINVAL)
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*
|
||||
* If SA_SIGINFO was specified or the compatibility trampolines
|
||||
* can't be used, use the siginfo trampoline.
|
||||
*/
|
||||
return __sigaction_sigtramp(sig, act, oact, __sigtramp_siginfo_2, 2);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue