File: sigsuspend.c

package info (click to toggle)
klibc 2.0.4-9
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,512 kB
  • sloc: ansic: 48,305; asm: 2,578; perl: 797; makefile: 200; sh: 191
file content (36 lines) | stat: -rw-r--r-- 665 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * sigsuspend.c
 */

#include <signal.h>
#include <sys/syscall.h>
#include <klibc/sysconfig.h>
#include <klibc/havesyscall.h>

#if _KLIBC_USE_RT_SIG

__extern int __rt_sigsuspend(const sigset_t *, size_t);

int sigsuspend(const sigset_t * mask)
{
	return __rt_sigsuspend(mask, sizeof *mask);
}

#else

extern int __sigsuspend_s(sigset_t);
extern int __sigsuspend_xxs(int, int, sigset_t);

int
sigsuspend(const sigset_t *maskp)
{
#ifdef _KLIBC_HAVE_SYSCALL___sigsuspend_s
	return __sigsuspend_s(*maskp);
#elif defined(_KLIBC_HAVE_SYSCALL___sigsuspend_xxs)
	return __sigsuspend_xxs(0, 0, *maskp);
#else
# error "Unknown sigsuspend implementation"
#endif
}

#endif