Skip to content

Commit

Permalink
Clean up nptl/tst-join5 use of nanosleep.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roland McGrath committed Feb 6, 2015
1 parent 8c28bbc commit ca0e067
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
2015-02-06 Roland McGrath <roland@hack.frob.com>

* nptl/tst-join5.c: Drop #include <sys/syscall.h>.
(wait_code): New function replaces macro.
Call nanosleep rather than syscall.

* nptl/pt-system.c: Rewritten. Put everything under
[SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)].
Use IFUNC to redirect when possible.
Expand Down
14 changes: 7 additions & 7 deletions nptl/tst-join5.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <sys/syscall.h>


#define wait_code() \
do { \
struct timespec ts = { .tv_sec = 0, .tv_nsec = 200000000 }; \
while (syscall (__NR_nanosleep, &ts, &ts) < 0) \
/* nothing */; \
} while (0)
static void
wait_code (void)
{
struct timespec ts = { .tv_sec = 0, .tv_nsec = 200000000 };
while (nanosleep (&ts, &ts) < 0)
;
}


#ifdef WAIT_IN_CHILD
Expand Down

0 comments on commit ca0e067

Please sign in to comment.