diff options
Diffstat (limited to 'libc')
-rw-r--r-- | libc/inet/resolv.c | 1 | ||||
-rw-r--r-- | libc/misc/sysvipc/msgq.c | 102 | ||||
-rw-r--r-- | libc/stdio/_stdio.c | 33 | ||||
-rw-r--r-- | libc/stdio/_stdio.h | 8 | ||||
-rw-r--r-- | libc/stdio/fflush.c | 4 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/bits/uClibc_mutex.h | 56 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/bits/uClibc_stdio.h | 73 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/pause.c | 30 |
8 files changed, 151 insertions, 156 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index 6ddbd5c31..b30d55f2c 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -155,6 +155,7 @@ #include <sys/utsname.h> #include <sys/un.h> #include <bits/uClibc_mutex.h> +#include <tls.h> /* poll() is not supported in kernel <= 2.0, therefore if __NR_poll is * not available, we assume an old Linux kernel is in use and we will diff --git a/libc/misc/sysvipc/msgq.c b/libc/misc/sysvipc/msgq.c index fc0279119..59fd47424 100644 --- a/libc/misc/sysvipc/msgq.c +++ b/libc/misc/sysvipc/msgq.c @@ -1,6 +1,11 @@ #include <errno.h> #include <sys/msg.h> #include "ipc.h" +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ +#include "sysdep-cancel.h" +#else +#define SINGLE_THREAD_P 1 +#endif #ifdef L_msgctl @@ -42,83 +47,66 @@ struct new_msg_buf{ #ifdef L_msgrcv -#ifdef __UCLIBC_HAS_THREADS_NATIVE__ -#include <sysdep-cancel.h> - -int -__libc_msgrcv (int msqid, void *msgp, size_t msgsz, long int msgtyp, int msgflg) +#ifdef __NR_msgrcv +#define __NR___syscall_msgrcv __NR_msgrcv +static inline _syscall5(int, __syscall_msgrcv, int, msqid, void *, msgp, + size_t, msgsz, long int, msgtyp, int, msgflg); +#endif +static inline int do_msgrcv (int msqid, void *msgp, size_t msgsz, + long int msgtyp, int msgflg) { - /* The problem here is that Linux' calling convention only allows up to - fives parameters to a system call. */ - struct new_msg_buf tmp; - - tmp.oldmsg = msgp; - tmp.r_msgtyp = msgtyp; - - if (SINGLE_THREAD_P) - return INLINE_SYSCALL (ipc, 5, IPCOP_msgrcv, msqid, msgsz, msgflg, - __ptrvalue (&tmp)); - - int oldtype = LIBC_CANCEL_ASYNC (); - - int result = INLINE_SYSCALL (ipc, 5, IPCOP_msgrcv, msqid, msgsz, msgflg, - __ptrvalue (&tmp)); - - LIBC_CANCEL_RESET (oldtype); - - return result; -} -weak_alias(__libc_msgrcv, msgrcv) -#else #ifdef __NR_msgrcv -_syscall5(int, msgrcv, int, msqid, void *, msgp, size_t, msgsz, long int, msgtyp, int, msgflg); + return __syscall_msgrcv(msqid, msgp, msgsz, msgtyp, msgflg); #else -int msgrcv (int msqid, void *msgp, size_t msgsz, - long int msgtyp, int msgflg) -{ struct new_msg_buf temp; temp.r_msgtyp = msgtyp; temp.oldmsg = msgp; return __syscall_ipc(IPCOP_msgrcv ,msqid ,msgsz ,msgflg ,&temp, 0); -} #endif +} +int msgrcv (int msqid, void *msgp, size_t msgsz, + long int msgtyp, int msgflg) +{ + if (SINGLE_THREAD_P) + return do_msgrcv(msqid, msgp, msgsz, msgtyp, msgflg); +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ + int oldtype = LIBC_CANCEL_ASYNC (); + int result = do_msgrcv(msqid, msgp, msgsz, msgtyp, msgflg); + LIBC_CANCEL_RESET (oldtype); + return result; #endif +} #endif #ifdef L_msgsnd -#ifdef __UCLIBC_HAS_THREADS_NATIVE__ -#include <sysdep-cancel.h> - -int -__libc_msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg) -{ - if (SINGLE_THREAD_P) - return INLINE_SYSCALL (ipc, 5, IPCOP_msgsnd, msqid, msgsz, - msgflg, msgp); - - int oldtype = LIBC_CANCEL_ASYNC (); - - int result = INLINE_SYSCALL (ipc, 5, IPCOP_msgsnd, msqid, msgsz, - msgflg, msgp); - - LIBC_CANCEL_RESET (oldtype); - - return result; -} -weak_alias(__libc_msgsnd, msgsnd) -#else #ifdef __NR_msgsnd -_syscall4(int, msgsnd, int, msqid, const void *, msgp, size_t, msgsz, int, msgflg); -#else +#define __NR___syscall_msgsnd __NR_msgsnd +static inline _syscall4(int, __syscall_msgsnd, int, msqid, const void *, msgp, + size_t, msgsz, int, msgflg); +#endif /* Send message to message queue. */ -int msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg) +static inline int do_msgsnd (int msqid, const void *msgp, size_t msgsz, + int msgflg) { +#ifdef __NR_msgsnd + return __syscall_msgsnd(msqid, msgp, msgsz, msgflg); +#else return __syscall_ipc(IPCOP_msgsnd, msqid, msgsz, msgflg, (void *)msgp, 0); -} #endif +} +int msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg) +{ + if (SINGLE_THREAD_P) + return do_msgsnd(msqid, msgp, msgsz, msgflg); +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ + int oldtype = LIBC_CANCEL_ASYNC (); + int result = do_msgsnd(msqid, msgp, msgsz, msgflg); + LIBC_CANCEL_RESET (oldtype); + return result; #endif +} #endif diff --git a/libc/stdio/_stdio.c b/libc/stdio/_stdio.c index 6084abec9..e8206889e 100644 --- a/libc/stdio/_stdio.c +++ b/libc/stdio/_stdio.c @@ -7,7 +7,11 @@ #include "_stdio.h" -/* Experimentally off - libc_hidden_proto(memcpy) */ +#if defined (__UCLIBC_HAS_THREADS__) && defined (__USE_STDIO_FUTEXES__) +#include <bits/stdio-lock.h> +#endif + +libc_hidden_proto(memcpy) libc_hidden_proto(isatty) /* This is pretty much straight from uClibc, but with one important @@ -160,18 +164,21 @@ FILE *_stdio_openlist = _stdio_streams; # ifdef __UCLIBC_HAS_THREADS__ # ifdef __USE_STDIO_FUTEXES__ -# define __UCLIBC_IO_MUTEX_INITIALIZER _IO_lock_initializer +_IO_lock_t _stdio_openlist_add_lock = _IO_lock_initializer; # else -# define __UCLIBC_IO_MUTEX_INITIALIZER PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP +__UCLIBC_MUTEX_INIT(_stdio_openlist_add_lock, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP); +# endif +#ifdef __STDIO_BUFFERS +# ifdef __USE_STDIO_FUTEXES__ +_IO_lock_t _stdio_openlist_del_lock = _IO_lock_initializer; +# else +__UCLIBC_MUTEX_INIT(_stdio_openlist_del_lock, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP); # endif - -__UCLIBC_IO_MUTEX_INIT(_stdio_openlist_add_lock, __UCLIBC_IO_MUTEX_INITIALIZER); -# ifdef __STDIO_BUFFERS -__UCLIBC_IO_MUTEX_INIT(_stdio_openlist_del_lock, __UCLIBC_IO_MUTEX_INITIALIZER); volatile int _stdio_openlist_use_count = 0; int _stdio_openlist_del_count = 0; -# endif +#endif # endif + #endif /**********************************************************************/ #ifdef __UCLIBC_HAS_THREADS__ @@ -179,6 +186,7 @@ int _stdio_openlist_del_count = 0; /* 2 if threading not initialized and 0 otherwise; */ int _stdio_user_locking = 2; +#ifndef __USE_STDIO_FUTEXES__ void attribute_hidden __stdio_init_mutex(__UCLIBC_MUTEX_TYPE *m) { const __UCLIBC_MUTEX_STATIC(__stdio_mutex_initializer, @@ -186,6 +194,7 @@ void attribute_hidden __stdio_init_mutex(__UCLIBC_MUTEX_TYPE *m) memcpy(m, &__stdio_mutex_initializer, sizeof(__stdio_mutex_initializer)); } +#endif #endif /**********************************************************************/ @@ -204,7 +213,7 @@ void attribute_hidden _stdio_term(void) STDIO_INIT_MUTEX(_stdio_openlist_add_lock); #warning check #ifdef __STDIO_BUFFERS - STDIO_INIT_MUTEX(_stdio_openlist_del_lock); + STDIO_INIT_MUTEX(ptr->__lock); /* Shouldn't be necessary, but... */ #endif /* Next we need to worry about the streams themselves. If a stream @@ -226,7 +235,11 @@ void attribute_hidden _stdio_term(void) } ptr->__user_locking = 1; /* Set locking mode to "by caller". */ - STDIO_INIT_MUTEX(ptr->__lock); /* Shouldn't be necessary, but... */ +#ifdef __USE_STDIO_FUTEXES__ + _IO_lock_init (ptr->_lock); +#else + __stdio_init_mutex(&ptr->__lock); /* Shouldn't be necessary, but... */ +#endif } #endif diff --git a/libc/stdio/_stdio.h b/libc/stdio/_stdio.h index e8ef08983..27075a8ac 100644 --- a/libc/stdio/_stdio.h +++ b/libc/stdio/_stdio.h @@ -24,18 +24,18 @@ #include <bits/uClibc_mutex.h> #define __STDIO_THREADLOCK_OPENLIST_ADD \ - __UCLIBC_IO_MUTEX_LOCK(_stdio_openlist_add_lock) + __UCLIBC_MUTEX_LOCK(_stdio_openlist_add_lock) #define __STDIO_THREADUNLOCK_OPENLIST_ADD \ - __UCLIBC_IO_MUTEX_UNLOCK(_stdio_openlist_add_lock) + __UCLIBC_MUTEX_UNLOCK(_stdio_openlist_add_lock) #ifdef __STDIO_BUFFERS #define __STDIO_THREADLOCK_OPENLIST_DEL \ - __UCLIBC_IO_MUTEX_LOCK(_stdio_openlist_del_lock) + __UCLIBC_MUTEX_LOCK(_stdio_openlist_del_lock) #define __STDIO_THREADUNLOCK_OPENLIST_DEL \ - __UCLIBC_IO_MUTEX_UNLOCK(_stdio_openlist_del_lock) + __UCLIBC_MUTEX_UNLOCK(_stdio_openlist_del_lock) #ifdef __UCLIBC_HAS_THREADS__ diff --git a/libc/stdio/fflush.c b/libc/stdio/fflush.c index 11b837dde..e1527b3a3 100644 --- a/libc/stdio/fflush.c +++ b/libc/stdio/fflush.c @@ -19,11 +19,11 @@ libc_hidden_proto(fflush_unlocked) * when all (lbf) writing streams are flushed. */ #define __MY_STDIO_THREADLOCK(__stream) \ - __UCLIBC_IO_MUTEX_CONDITIONAL_LOCK((__stream)->__lock, \ + __UCLIBC_MUTEX_CONDITIONAL_LOCK((__stream)->__lock, \ (_stdio_user_locking != 2)) #define __MY_STDIO_THREADUNLOCK(__stream) \ - __UCLIBC_IO_MUTEX_CONDITIONAL_UNLOCK((__stream)->__lock, \ + __UCLIBC_MUTEX_CONDITIONAL_UNLOCK((__stream)->__lock, \ (_stdio_user_locking != 2)) #if defined(__UCLIBC_HAS_THREADS__) && defined(__STDIO_BUFFERS) diff --git a/libc/sysdeps/linux/common/bits/uClibc_mutex.h b/libc/sysdeps/linux/common/bits/uClibc_mutex.h index e31767787..14aeb9c80 100644 --- a/libc/sysdeps/linux/common/bits/uClibc_mutex.h +++ b/libc/sysdeps/linux/common/bits/uClibc_mutex.h @@ -12,7 +12,8 @@ #ifdef __UCLIBC_HAS_THREADS__ -#include <bits/pthreadtypes.h> +#include <pthread.h> +#include <bits/uClibc_pthread.h> #define __UCLIBC_MUTEX_TYPE pthread_mutex_t @@ -61,53 +62,6 @@ #define __UCLIBC_MUTEX_UNLOCK(M) \ __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M, 1) -#ifdef __USE_STDIO_FUTEXES__ - -#include <bits/stdio-lock.h> - -#define __UCLIBC_IO_MUTEX(M) _IO_lock_t M -#define __UCLIBC_IO_MUTEX_LOCK(M) _IO_lock_lock(M) -#define __UCLIBC_IO_MUTEX_UNLOCK(M) _IO_lock_unlock(M) -#define __UCLIBC_IO_MUTEX_TRYLOCK(M) _IO_lock_trylock(M) -#define __UCLIBC_IO_MUTEX_INIT(M,I) _IO_lock_t M = I -#define __UCLIBC_IO_MUTEX_EXTERN(M) extern _IO_lock_t M - -#define __UCLIBC_IO_MUTEX_CONDITIONAL_LOCK(M,C) \ - if (C) { \ - _IO_lock_lock(M); \ - } - -#define __UCLIBC_IO_MUTEX_CONDITIONAL_UNLOCK(M,C) \ - if (C) { \ - _IO_lock_unlock(M); \ - } - -#define __UCLIBC_IO_MUTEX_AUTO_LOCK(M,A,V) \ - __UCLIBC_IO_MUTEX_CONDITIONAL_LOCK(M,((A=(V))) == 0) - -#define __UCLIBC_IO_MUTEX_AUTO_UNLOCK(M,A) \ - __UCLIBC_IO_MUTEX_CONDITIONAL_UNLOCK(M,((A) ==0)) - -#define __UCLIBC_IO_MUTEX_LOCK_CANCEL_UNSAFE(M) \ - __UCLIBC_IO_MUTEX_LOCK(M) -#define __UCLIBC_IO_MUTEX_UNLOCK_CANCEL_UNSAFE(M) \ - __UCLIBC_IO_MUTEX_UNLOCK(M) -#define __UCLIBC_IO_MUTEX_TRYLOCK_CANCEL_UNSAFE(M) \ - __UCLIBC_IO_MUTEX_TRYLOCK(M) - -#else -#define __UCLIBC_IO_MUTEX(M) __UCLIBC_MUTEX(M) -#define __UCLIBC_IO_MUTEX_LOCK(M) __UCLIBC_MUTEX_CONDITIONAL_LOCK(M, 1) -#define __UCLIBC_IO_MUTEX_UNLOCK(M) __UCLIBC_MUTEX_CONDITIONAL_UNLOCK(M, 1) -#define __UCLIBC_IO_MUTEX_TRYLOCK(M) __UCLIBC_MUTEX_TRYLOCK_CANCEL_UNSAFE -#define __UCLIBC_IO_MUTEX_INIT(M,I) __UCLIBC_MUTEX_INIT(M,I) -#define __UCLIBC_IO_MUTEX_EXTERN(M) __UCLIBC_MUTEX_EXTERN(M) - -#define __UCLIBC_IO_MUTEX_AUTO_LOCK(M,A,V) __UCLIBC_MUTEX_AUTO_LOCK(M,A,V) -#define __UCLIBC_IO_MUTEX_AUTO_UNLOCK(M,A) __UCLIBC_MUTEX_AUTO_UNLOCK(M,A) - -#endif - #else #define __UCLIBC_MUTEX(M) void *__UCLIBC_MUTEX_DUMMY_ ## M @@ -129,12 +83,6 @@ #define __UCLIBC_MUTEX_LOCK(M) ((void)0) #define __UCLIBC_MUTEX_UNLOCK(M) ((void)0) -#define __UCLIBC_IO_MUTEX_LOCK(M) ((void)0) -#define __UCLIBC_IO_MUTEX_UNLOCK(M) ((void)0) -#define __UCLIBC_IO_MUTEX_TRYLOCK(M) ((void)0) -#define __UCLIBC_IO_MUTEX_INIT(M,I) extern void *__UCLIBC_MUTEX_DUMMY_ ## M -#define __UCLIBC_IO_MUTEX_EXTERN(M) extern void *__UCLIBC_MUTEX_DUMMY_ ## M #endif - #endif /* _UCLIBC_MUTEX_H */ diff --git a/libc/sysdeps/linux/common/bits/uClibc_stdio.h b/libc/sysdeps/linux/common/bits/uClibc_stdio.h index 0af2d5db5..101944acb 100644 --- a/libc/sysdeps/linux/common/bits/uClibc_stdio.h +++ b/libc/sysdeps/linux/common/bits/uClibc_stdio.h @@ -117,6 +117,9 @@ /**********************************************************************/ #include <bits/uClibc_mutex.h> +#ifdef __USE_STDIO_FUTEXES__ +#include <bits/stdio-lock.h> +#endif /* user_locking * 0 : do auto locking/unlocking @@ -132,28 +135,64 @@ #define __STDIO_AUTO_THREADLOCK_VAR \ __UCLIBC_MUTEX_AUTO_LOCK_VAR(__infunc_user_locking) +#ifdef __USE_STDIO_FUTEXES__ + +#define __STDIO_SET_USER_LOCKING(__stream) ((__stream)->__user_locking = 1) + +#define __STDIO_AUTO_THREADLOCK(__stream) \ + if ((__infunc_user_locking = (__stream)->__user_locking) == 0) { \ + _IO_lock_lock((__stream)->_lock); \ + } + +#define __STDIO_AUTO_THREADUNLOCK(__stream) \ + if (__infunc_user_locking == 0) { \ + _IO_lock_unlock((__stream)->_lock); \ + } + +#define __STDIO_ALWAYS_THREADLOCK(__stream) \ + _IO_lock_lock((__stream)->_lock) + +#define __STDIO_ALWAYS_THREADTRYLOCK(__stream) \ + _IO_lock_trylock((__stream)->_lock) + +#define __STDIO_ALWAYS_THREADUNLOCK(__stream) \ + _IO_lock_unlock((__stream)->_lock) + +#define __STDIO_ALWAYS_THREADLOCK_CANCEL_UNSAFE(__stream) \ + _IO_lock_lock_cancel_unsafe((__stream)->__lock) + +#define __STDIO_ALWAYS_THREADTRYLOCK_CANCEL_UNSAFE(__stream) \ + _IO_lock_trylock_cancel_unsafe((__stream)->__lock) + +#define __STDIO_ALWAYS_THREADUNLOCK_CANCEL_UNSAFE(__stream) \ + _IO_lock_unlock_cancel_unsafe((__stream)->__lock) + +#else /* __USE_STDIO_FUTEXES__ */ + #define __STDIO_AUTO_THREADLOCK(__stream) \ - __UCLIBC_IO_MUTEX_AUTO_LOCK((__stream)->__lock, __infunc_user_locking, \ + __UCLIBC_MUTEX_AUTO_LOCK((__stream)->__lock, __infunc_user_locking, \ (__stream)->__user_locking) #define __STDIO_AUTO_THREADUNLOCK(__stream) \ - __UCLIBC_IO_MUTEX_AUTO_UNLOCK((__stream)->__lock, __infunc_user_locking) + __UCLIBC_MUTEX_AUTO_UNLOCK((__stream)->__lock, __infunc_user_locking) #define __STDIO_ALWAYS_THREADLOCK(__stream) \ - __UCLIBC_IO_MUTEX_LOCK((__stream)->__lock) + __UCLIBC_MUTEX_LOCK((__stream)->__lock) #define __STDIO_ALWAYS_THREADUNLOCK(__stream) \ - __UCLIBC_IO_MUTEX_UNLOCK((__stream)->__lock) + __UCLIBC_MUTEX_UNLOCK((__stream)->__lock) #define __STDIO_ALWAYS_THREADLOCK_CANCEL_UNSAFE(__stream) \ - __UCLIBC_IO_MUTEX_LOCK_CANCEL_UNSAFE((__stream)->__lock) + __UCLIBC_MUTEX_LOCK_CANCEL_UNSAFE((__stream)->__lock) #define __STDIO_ALWAYS_THREADTRYLOCK_CANCEL_UNSAFE(__stream) \ - __UCLIBC_IO_MUTEX_TRYLOCK_CANCEL_UNSAFE((__stream)->__lock) + __UCLIBC_MUTEX_TRYLOCK_CANCEL_UNSAFE((__stream)->__lock) #define __STDIO_ALWAYS_THREADUNLOCK_CANCEL_UNSAFE(__stream) \ - __UCLIBC_IO_MUTEX_UNLOCK_CANCEL_UNSAFE((__stream)->__lock) + __UCLIBC_MUTEX_UNLOCK_CANCEL_UNSAFE((__stream)->__lock) + +#endif #ifdef __UCLIBC_HAS_THREADS__ #define __STDIO_SET_USER_LOCKING(__stream) ((__stream)->__user_locking = 1) @@ -161,13 +200,11 @@ #define __STDIO_SET_USER_LOCKING(__stream) ((void)0) #endif -#ifdef __UCLIBC_HAS_THREADS__ #ifdef __USE_STDIO_FUTEXES__ #define STDIO_INIT_MUTEX(M) _IO_lock_init(M) #else #define STDIO_INIT_MUTEX(M) __stdio_init_mutex(& M) #endif -#endif /**********************************************************************/ @@ -283,7 +320,11 @@ struct __STDIO_FILE_STRUCT { #endif #ifdef __UCLIBC_HAS_THREADS__ int __user_locking; - __UCLIBC_IO_MUTEX(__lock); +#ifdef __USE_STDIO_FUTEXES__ + _IO_lock_t _lock; +#else + __UCLIBC_MUTEX(__lock); +#endif #endif /* Everything after this is unimplemented... and may be trashed. */ #if __STDIO_BUILTIN_BUF_SIZE > 0 @@ -359,9 +400,17 @@ extern void _stdio_term(void) attribute_hidden; extern struct __STDIO_FILE_STRUCT *_stdio_openlist; #ifdef __UCLIBC_HAS_THREADS__ -__UCLIBC_IO_MUTEX_EXTERN(_stdio_openlist_add_lock); +#ifdef __USE_STDIO_FUTEXES__ +extern _IO_lock_t _stdio_openlist_add_lock; +#else +__UCLIBC_MUTEX_EXTERN(_stdio_openlist_add_lock); +#endif #ifdef __STDIO_BUFFERS -__UCLIBC_IO_MUTEX_EXTERN(_stdio_openlist_del_lock); +#ifdef __USE_STDIO_FUTEXES__ +extern _IO_lock_t _stdio_openlist_del_lock; +#else +__UCLIBC_MUTEX_EXTERN(_stdio_openlist_del_lock); +#endif extern volatile int _stdio_openlist_use_count; /* _stdio_openlist_del_lock */ extern int _stdio_openlist_del_count; /* _stdio_openlist_del_lock */ #endif diff --git a/libc/sysdeps/linux/common/pause.c b/libc/sysdeps/linux/common/pause.c index 31d3563fb..22a039b4f 100644 --- a/libc/sysdeps/linux/common/pause.c +++ b/libc/sysdeps/linux/common/pause.c @@ -10,23 +10,19 @@ #define __UCLIBC_HIDE_DEPRECATED__ #include <sys/syscall.h> #include <unistd.h> -#include <sysdep-cancel.h> -/* Suspend the process until a signal arrives. - This always returns -1 and sets errno to EINTR. */ -int -__libc_pause (void) -{ - sigset_t set; - - __sigemptyset (&set); - sigprocmask (SIG_BLOCK, NULL, &set); - - /* pause is a cancellation point, but so is sigsuspend. - So no need for anything special here. */ +extern __typeof(pause) __libc_pause; +#ifdef __NR_pause +#define __NR___libc_pause __NR_pause +_syscall0(int, __libc_pause); +#else +#include <signal.h> +libc_hidden_proto(__sigpause) +libc_hidden_proto(sigblock) - return sigsuspend (&set); +int __libc_pause(void) +{ + return (__sigpause(sigblock(0), 0)); } -weak_alias (__libc_pause, pause) - -LIBC_CANCEL_HANDLED (); /* sigsuspend handles our cancellation. */ +#endif +weak_alias(__libc_pause,pause) |