summaryrefslogtreecommitdiffstats
path: root/usr/klibc/arch/sparc/sigaction.c
blob: 5c31a52bb9ed174d7280701cdf9e76b9e8760094 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * sigaction.c
 */

#include <signal.h>
#include <sys/syscall.h>

__extern void __sigreturn(void);
__extern int ____rt_sigaction(int, const struct sigaction *, struct sigaction *,
			      void (*)(void), size_t);

int __rt_sigaction(int sig, const struct sigaction *act,
		   struct sigaction *oact, size_t size)
{
	void (*restorer)(void);

	restorer = (act && act->sa_flags & SA_RESTORER)
		? (void (*)(void))((uintptr_t)act->sa_restorer - 8)
		: NULL;
	return ____rt_sigaction(sig, act, oact, restorer, size);
}