Sync with the i386 version.

This commit is contained in:
briggs 2003-10-18 18:36:35 +00:00
parent 3825627f57
commit 6646629469

View File

@ -1,4 +1,4 @@
/* $NetBSD: __sigaction14_sigtramp.c,v 1.3 2003/10/06 22:57:23 fvdl Exp $ */
/* $NetBSD: __sigaction14_sigtramp.c,v 1.4 2003/10/18 18:36:35 briggs Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -48,8 +48,31 @@
int
__libc_sigaction14(int sig, const struct sigaction *act, struct sigaction *oact)
{
extern int __sigtramp_siginfo_2[];
extern const int __sigtramp_sigcontext_1[];
extern const int __sigtramp_siginfo_2[];
int rv;
return (__sigaction_sigtramp(sig, act, oact,
__sigtramp_siginfo_2, 2));
/*
* If no sigaction, use the "default" trampoline since it won't
* be used.
*/
if (act == NULL)
return __sigaction_sigtramp(sig, act, oact, NULL, 0);
/*
* 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);
}