]>
git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c
1 /* POSIX.1 sigaction call for Linux/SPARC64.
2 Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Miguel de Icaza (miguel@nuclecu.unam.mx) and
5 Jakub Jelinek (jj@ultra.linux.cz).
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version.
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public
18 License along with the GNU C Library; see the file COPYING.LIB. If not,
19 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
25 #include <sys/signal.h>
27 #include <kernel_sigaction.h>
29 /* SPARC 64bit userland requires a kernel that has rt signals anyway. */
31 static void __rt_sigreturn_stub (void);
34 __sigaction (int sig
, __const
struct sigaction
*act
, struct sigaction
*oact
)
37 struct kernel_sigaction kact
, koact
;
38 unsigned long stub
= ((unsigned long) &__rt_sigreturn_stub
) - 8;
42 kact
.k_sa_handler
= act
->sa_handler
;
43 memcpy (&kact
.sa_mask
, &act
->sa_mask
, sizeof (sigset_t
));
44 kact
.sa_flags
= act
->sa_flags
;
45 kact
.sa_restorer
= NULL
;
48 /* XXX The size argument hopefully will have to be changed to the
49 real size of the user-level sigset_t. */
50 ret
= INLINE_SYSCALL (rt_sigaction
, 5, sig
, act
? &kact
: 0,
51 oact
? &koact
: 0, stub
, _NSIG
/ 8);
55 oact
->sa_handler
= koact
.k_sa_handler
;
56 memcpy (&oact
->sa_mask
, &koact
.sa_mask
, sizeof (sigset_t
));
57 oact
->sa_flags
= koact
.sa_flags
;
58 oact
->sa_restorer
= koact
.sa_restorer
;
64 weak_alias (__sigaction
, sigaction
);
67 __rt_sigreturn_stub (void)
69 __asm__ ("mov %0, %%g1\n\t"
72 : "i" (__NR_rt_sigreturn
));