OSDN Git Service

sigsuspend.c: add cancellation support independently of rt_sigsuspend
[uclinux-h8/uclibc-ng.git] / 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 #ifdef __USE_POSIX
13 #include <signal.h>
14 #include <cancel.h>
15
16 int __NC(sigsuspend)(const sigset_t *set)
17 {
18 #ifdef __NR_rt_sigsuspend
19         return INLINE_SYSCALL(rt_sigsuspend, 2, set, __SYSCALL_SIGSET_T_SIZE);
20 #else
21         return INLINE_SYSCALL(sigsuspend, 3, 0, 0, set->__val[0]);
22 #endif
23 }
24 CANCELLABLE_SYSCALL(int, sigsuspend, (const sigset_t *set), (set))
25 lt_libc_hidden(sigsuspend)
26 #endif