1 /* Internal sigsuspend system call for LinuxThreads. Generic Linux version.
2 Copyright (C) 2003 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
25 #include <sys/syscall.h>
26 #include <linuxthreads/internals.h>
28 #include "kernel-features.h"
31 __pthread_sigsuspend (const sigset_t
*set
)
33 INTERNAL_SYSCALL_DECL (err
);
34 #if !__ASSUME_REALTIME_SIGNALS
35 static int __pthread_missing_rt_sigs
;
37 # ifdef __NR_rt_sigsuspend
38 /* First try the RT signals. */
39 if (!__pthread_missing_rt_sigs
)
41 /* XXX The size argument hopefully will have to be changed to the
42 real size of the user-level sigset_t. */
44 r
= INTERNAL_SYSCALL (rt_sigsuspend
, err
, 2, set
, _NSIG
/ 8);
45 if (INTERNAL_SYSCALL_ERRNO (r
, err
) != ENOSYS
)
48 __pthread_missing_rt_sigs
= 1;
52 INTERNAL_SYSCALL (sigsuspend
, err
, 3, 0, 0, set
->__val
[0]);
54 INTERNAL_SYSCALL (rt_sigsuspend
, err
, 2, set
, _NSIG
/ 8);