blob: a77c4d58177d333df1b8968c05e3e60444f90bc3 (
plain)
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
37
38
39
40
41
|
/* vi: set sw=4 ts=4: */
/*
* pause() for uClibc
*
* Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#define __need_NULL
#include <stddef.h>
#include <unistd.h>
#ifdef __UCLIBC_HAS_THREADS_NATIVE__
#include <sysdep-cancel.h>
#endif
#include <signal.h>
/* Suspend the process until a signal arrives.
This always returns -1 and sets errno to EINTR. */
extern __typeof(pause) __libc_pause;
int
__libc_pause (void)
{
sigset_t set;
/*__sigemptyset (&set); - why? */
sigprocmask (SIG_BLOCK, NULL, &set);
/* pause is a cancellation point, but so is sigsuspend.
So no need for anything special here. */
return sigsuspend (&set);
}
weak_alias (__libc_pause, pause)
#ifdef __UCLIBC_HAS_THREADS_NATIVE__
LIBC_CANCEL_HANDLED (); /* sigsuspend handles our cancellation. */
#endif
|