[klibc] alpha: fix signal handler setup on DEC Alpha

We need a five-argument rt_sigaction syscall form with a hidden
argument but that can be NULL as the kernel sets it up for us
better than we can (easily) do, at speed cost.

Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
[ Mark alpha as working. -maks ]
Signed-off-by: maximilian attems <max@stro.at>
diff --git a/usr/klibc/README.klibc b/usr/klibc/README.klibc
index 283b9db..47618ec 100644
--- a/usr/klibc/README.klibc
+++ b/usr/klibc/README.klibc
@@ -33,7 +33,7 @@
 
    The following is the last known status of various architectures:
 
-   alpha:	 Runtime breakage
+   alpha:	 Working
    arm-thumb:	 Untested
    arm:		 Working
    arm26:	 Not yet ported
diff --git a/usr/klibc/SYSCALLS.def b/usr/klibc/SYSCALLS.def
index 0463df8..9b07aa2 100644
--- a/usr/klibc/SYSCALLS.def
+++ b/usr/klibc/SYSCALLS.def
@@ -202,8 +202,9 @@
  * sanitizing <signal.h> for all architectures, sigh.  See <klibc/config.h>.
  */
 #if _KLIBC_USE_RT_SIG
-<!sparc,sparc64> int rt_sigaction::__rt_sigaction(int, const struct sigaction *, struct sigaction *, size_t);
+<!sparc,sparc64,alpha> int rt_sigaction::__rt_sigaction(int, const struct sigaction *, struct sigaction *, size_t);
 <sparc,sparc64> int rt_sigaction::__rt_sigaction(int, const struct sigaction *, struct sigaction *, void *, size_t);
+<alpha> int rt_sigaction::__rt_sigaction(int, const struct sigaction *, struct sigaction *, size_t, void *);
 int rt_sigsuspend::__rt_sigsuspend(const sigset_t *, size_t);
 int rt_sigpending::__rt_sigpending(sigset_t *, size_t);
 int rt_sigprocmask::__rt_sigprocmask(int, const sigset_t *, sigset_t *, size_t);
diff --git a/usr/klibc/sigaction.c b/usr/klibc/sigaction.c
index 658c3ad..19a8a54 100644
--- a/usr/klibc/sigaction.c
+++ b/usr/klibc/sigaction.c
@@ -11,6 +11,9 @@
 #ifdef __sparc__
 __extern int __rt_sigaction(int, const struct sigaction *, struct sigaction *,
 			    void (*)(void), size_t);
+#elif defined(__alpha__)
+__extern int __rt_sigaction(int, const struct sigaction *, struct sigaction *,
+			    size_t, void *);
 #else
 __extern int __rt_sigaction(int, const struct sigaction *, struct sigaction *,
 			    size_t);
@@ -43,6 +46,8 @@
 			: NULL;
 		rv = __rt_sigaction(sig, act, oact, restorer, sizeof(sigset_t));
 	}
+# elif defined(__alpha__)
+	rv = __rt_sigaction(sig, act, oact, sizeof(sigset_t), NULL);
 # else
 	rv = __rt_sigaction(sig, act, oact, sizeof(sigset_t));
 # endif