]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/uclibc/lib/contrib/uclibc/libc/sysdeps/linux/common/sigsuspend.c
3648e76b53ddddeac8fa799f05ccaebc99c3487b
[l4.git] / l4 / pkg / uclibc / lib / contrib / uclibc / libc / sysdeps / linux / common / sigsuspend.c
1 /* vi: set sw=4 ts=4: */
2 /*
3  * sigsuspend() for uClibc
4  *
5  * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
6  *
7  * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
8  */
9
10 #include <sys/syscall.h>
11
12 #if defined __USE_POSIX
13 #include <signal.h>
14
15 extern __typeof(sigsuspend) __libc_sigsuspend;
16
17 #ifdef __NR_rt_sigsuspend
18 # define __NR___rt_sigsuspend __NR_rt_sigsuspend
19 static __inline__ _syscall2(int, __rt_sigsuspend, const sigset_t *, mask, size_t, size)
20
21 int __libc_sigsuspend(const sigset_t * mask)
22 {
23         return __rt_sigsuspend(mask, _NSIG / 8);
24 }
25 #else
26 # define __NR___syscall_sigsuspend __NR_sigsuspend
27 static __inline__ _syscall3(int, __syscall_sigsuspend, int, a, unsigned long int, b,
28                   unsigned long int, c)
29
30 int __libc_sigsuspend(const sigset_t * set)
31 {
32         return __syscall_sigsuspend(0, 0, set->__val[0]);
33 }
34 #endif
35 weak_alias(__libc_sigsuspend,sigsuspend)
36 libc_hidden_weak(sigsuspend)
37 #endif