mirror of
https://sourceware.org/git/glibc.git
synced 2025-12-08 02:02:23 +03:00
Clean up nptl/tst-join5 use of nanosleep.
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
2015-02-06 Roland McGrath <roland@hack.frob.com>
|
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
|
* nptl/pt-system.c: Rewritten. Put everything under
|
||||||
[SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)].
|
[SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)].
|
||||||
Use IFUNC to redirect when possible.
|
Use IFUNC to redirect when possible.
|
||||||
|
|||||||
@@ -22,15 +22,15 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/syscall.h>
|
|
||||||
|
|
||||||
|
|
||||||
#define wait_code() \
|
static void
|
||||||
do { \
|
wait_code (void)
|
||||||
struct timespec ts = { .tv_sec = 0, .tv_nsec = 200000000 }; \
|
{
|
||||||
while (syscall (__NR_nanosleep, &ts, &ts) < 0) \
|
struct timespec ts = { .tv_sec = 0, .tv_nsec = 200000000 };
|
||||||
/* nothing */; \
|
while (nanosleep (&ts, &ts) < 0)
|
||||||
} while (0)
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef WAIT_IN_CHILD
|
#ifdef WAIT_IN_CHILD
|
||||||
|
|||||||
Reference in New Issue
Block a user