Przeglądaj źródła

pause.c: use cancel.h, provide __libc_pause only for LT_OLD

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Peter S. Mazinger 14 lat temu
rodzic
commit
2d9054b39a
1 zmienionych plików z 12 dodań i 21 usunięć
  1. 12 21
      libc/sysdeps/linux/common/pause.c

+ 12 - 21
libc/sysdeps/linux/common/pause.c

@@ -10,32 +10,23 @@
 #define __need_NULL
 #include <stddef.h>
 #include <unistd.h>
-
-#ifdef __UCLIBC_HAS_THREADS_NATIVE__
-#include <sysdep-cancel.h>
-#endif
-
 #include <signal.h>
+#include <cancel.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)
+#ifdef __LINUXTHREADS_OLD__
+weak_function
+#endif
+pause(void)
 {
-  sigset_t set;
+	sigset_t set;
 
-  /*__sigemptyset (&set); - why? */
-  sigprocmask (SIG_BLOCK, NULL, &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);
+	/* 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__
+lt_strong_alias(pause)
 LIBC_CANCEL_HANDLED ();		/* sigsuspend handles our cancellation.  */
-#endif
-