about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/sigaction.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2018-12-11 16:57:49 -0200
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2018-12-18 19:52:21 -0200
commit56b98bf1fb819b357318f39fccf2901d3c6b41ec (patch)
tree082401b5aca4cfd946f8ea9911780b1ab46bf32d /sysdeps/unix/sysv/linux/sigaction.c
parent43a45c2d829f164c1fb94d5f44afe326fae946e1 (diff)
downloadglibc-56b98bf1fb819b357318f39fccf2901d3c6b41ec.tar.gz
glibc-56b98bf1fb819b357318f39fccf2901d3c6b41ec.tar.xz
glibc-56b98bf1fb819b357318f39fccf2901d3c6b41ec.zip
alpha: Use Linux generic sigaction implementation
Alpha rt_sigaction syscall uses a slight different kernel ABI than
generic one:

arch/alpha/kernel/signal.c

 90 SYSCALL_DEFINE5(rt_sigaction, int, sig, const struct sigaction __user *, act,
 91                 struct sigaction __user *, oact,
 92                 size_t, sigsetsize, void __user *, restorer)

Similar as sparc, the syscall expects a restorer function.  However
different than sparc, alpha defines the restorer as the 5th argument
(sparc defines as the 4th).

This patch removes the arch-specific alpha sigaction implementation,
adapt the Linux generic one to different restore placements (through
STUB macro), and make alpha use the Linux generic kernel_sigaction
definition.

Checked on alpha-linux-gnu and x86_64-linux-gnu (for sanity).

	* sysdeps/unix/sysv/linux/alpha/Makefile: Update comment about
	__syscall_rt_sigaction.
	* sysdeps/unix/sysv/linux/alpha/kernel_sigaction.h
	(kernel_sigaction): Use Linux generic defintion.
	(STUB): Define.
	(__syscall_rt_sigreturn, __syscall_sigreturn): Add prototype.
	* sysdeps/unix/sysv/linux/alpha/rt_sigaction.S
	(__syscall_rt_sigaction): Remove implementation.
	(__syscall_sigreturn, __syscall_rt_sigreturn): Define as global and
	hidden.
	* sysdeps/unix/sysv/linux/alpha/sigaction.c: Remove file.
	* sysdeps/unix/sysv/linux/alpha/sysdep.h (INLINE_SYSCALL,
	INTERNAL_SYSCALL): Remove definitions.
	* sysdeps/unix/sysv/linux/sigaction.c: Define STUB to accept both the
	action and signal set size.
	* sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c (STUB): Redefine.
	* sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c (STUB): Likewise.
Diffstat (limited to 'sysdeps/unix/sysv/linux/sigaction.c')
-rw-r--r--sysdeps/unix/sysv/linux/sigaction.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/sigaction.c b/sysdeps/unix/sysv/linux/sigaction.c
index 0e6851a148..233ab1fcb5 100644
--- a/sysdeps/unix/sysv/linux/sigaction.c
+++ b/sysdeps/unix/sysv/linux/sigaction.c
@@ -33,7 +33,7 @@
 
 /* SPARC passes the restore function as an argument to rt_sigaction.  */
 #ifndef STUB
-# define STUB(act)
+# define STUB(act, sigsetsize) (sigsetsize)
 #endif
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
@@ -57,7 +57,7 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
      real size of the user-level sigset_t.  */
   result = INLINE_SYSCALL_CALL (rt_sigaction, sig,
 				act ? &kact : NULL,
-				oact ? &koact : NULL, STUB(act) _NSIG / 8);
+				oact ? &koact : NULL, STUB (act, _NSIG / 8));
 
   if (oact && result >= 0)
     {