Selaa lähdekoodia

Daniel Jacobowitz: sleep()/usleep() relies on nanosleep() being a cancellation
point but the files have "libc_hidden_proto(nanosleep)" which means it always
calls the libc.so version, never the wrapped version in libpthread.so that's a
cancellation point.

Mike Frysinger 17 vuotta sitten
vanhempi
commit
ae0badd742
2 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 1 1
      libc/unistd/sleep.c
  2. 1 1
      libc/unistd/usleep.c

+ 1 - 1
libc/unistd/sleep.c

@@ -30,7 +30,7 @@ libc_hidden_proto(sigprocmask)
 //libc_hidden_proto(__sigaddset)
 //libc_hidden_proto(__sigemptyset)
 //libc_hidden_proto(__sigismember)
-libc_hidden_proto(nanosleep)
+/*libc_hidden_proto(nanosleep) need the reloc for cancellation*/
 
 #if 0
 /* This is a quick and dirty, but not 100% compliant with

+ 1 - 1
libc/unistd/usleep.c

@@ -9,7 +9,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-libc_hidden_proto(nanosleep)
+/*libc_hidden_proto(nanosleep) need the reloc for cancellation*/
 
 int usleep (__useconds_t usec)
 {