1 /* vi: set sw=4 ts=4: */
3 * sigsuspend() for uClibc
5 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
7 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
10 #include <sys/syscall.h>
12 #if defined __USE_POSIX
16 libc_hidden_proto(sigsuspend)
18 #ifdef __NR_rt_sigsuspend
19 # define __NR___rt_sigsuspend __NR_rt_sigsuspend
21 # ifdef __UCLIBC_HAS_THREADS_NATIVE__
23 # include <sysdep-cancel.h>
25 /* Change the set of blocked signals to SET,
26 wait until a signal arrives, and restore the set of blocked signals. */
27 int sigsuspend (const sigset_t *set)
30 return INLINE_SYSCALL (rt_sigsuspend, 2, set, _NSIG / 8);
32 int oldtype = LIBC_CANCEL_ASYNC ();
34 int result = INLINE_SYSCALL (rt_sigsuspend, 2, set, _NSIG / 8);
36 LIBC_CANCEL_RESET (oldtype);
41 static inline _syscall2(int, __rt_sigsuspend, const sigset_t *, mask, size_t, size)
43 int sigsuspend(const sigset_t * mask)
45 return __rt_sigsuspend(mask, _NSIG / 8);
49 # define __NR___syscall_sigsuspend __NR_sigsuspend
50 static __inline__ _syscall3(int, __syscall_sigsuspend, int, a, unsigned long int, b,
53 int sigsuspend(const sigset_t * set)
55 return __syscall_sigsuspend(0, 0, set->__val[0]);
58 libc_hidden_def(sigsuspend)