@@ -60,7 +60,7 @@ tf (void *arg)
/* Timeout: 0.3 secs. */
struct timespec ts_start;
- xclock_gettime (clockid_for_get, &ts_start);
+ __xclock_gettime (clockid_for_get, &ts_start);
struct timespec ts_timeout = timespec_add (ts_start,
__make_timespec (0, 300000000));
@@ -77,7 +77,7 @@ tf (void *arg)
TEST_TIMESPEC_NOW_OR_AFTER (CLOCK_REALTIME, ts_timeout);
- xclock_gettime (clockid_for_get, &ts_timeout);
+ __xclock_gettime (clockid_for_get, &ts_timeout);
ts_timeout.tv_sec += 10;
/* Note that the following operation makes ts invalid. */
ts_timeout.tv_nsec += 1000000000;
@@ -117,7 +117,7 @@ do_test_clock (clockid_t clockid, const char *fnname)
FAIL_EXIT1 ("round %Zu: rwlockattr_destroy failed\n", cnt);
struct timespec ts;
- xclock_gettime (clockid_for_get, &ts);
+ __xclock_gettime (clockid_for_get, &ts);
++ts.tv_sec;
/* Get a write lock. */
@@ -130,7 +130,7 @@ do_test_clock (clockid_t clockid, const char *fnname)
verbose_printf ("1st %swrlock done\n", fnname);
- xclock_gettime (clockid_for_get, &ts);
+ __xclock_gettime (clockid_for_get, &ts);
++ts.tv_sec;
if (clockid == CLOCK_USE_TIMEDLOCK)
TEST_COMPARE (pthread_rwlock_timedrdlock (&r, &ts), EDEADLK);
@@ -139,7 +139,7 @@ do_test_clock (clockid_t clockid, const char *fnname)
verbose_printf ("1st %srdlock done\n", fnname);
- xclock_gettime (clockid_for_get, &ts);
+ __xclock_gettime (clockid_for_get, &ts);
++ts.tv_sec;
if (clockid == CLOCK_USE_TIMEDLOCK)
TEST_COMPARE (pthread_rwlock_timedwrlock (&r, &ts), EDEADLK);
@@ -59,7 +59,7 @@ tf (void *arg)
/* Timeout: 0.3 secs. */
struct timespec ts_start;
- xclock_gettime (clockid_for_get, &ts_start);
+ __xclock_gettime (clockid_for_get, &ts_start);
const struct timespec ts_timeout = timespec_add (ts_start,
__make_timespec (0, 300000000));
@@ -73,7 +73,7 @@ tf (void *arg)
TEST_TIMESPEC_NOW_OR_AFTER (clockid_for_get, ts_timeout);
struct timespec ts_invalid;
- xclock_gettime (clockid_for_get, &ts_invalid);
+ __xclock_gettime (clockid_for_get, &ts_invalid);
ts_invalid.tv_sec += 10;
/* Note that the following operation makes ts invalid. */
ts_invalid.tv_nsec += 1000000000;
@@ -113,7 +113,7 @@ do_test_clock (clockid_t clockid, const char *fnname)
FAIL_EXIT1 ("round %Zu: rwlockattr_destroy failed\n", cnt);
struct timespec ts;
- xclock_gettime (clockid_for_get, &ts);
+ __xclock_gettime (clockid_for_get, &ts);
++ts.tv_sec;
@@ -73,7 +73,7 @@ writer_thread (void *arg)
int e;
do
{
- xclock_gettime (clockid_for_get, &ts);
+ __xclock_gettime (clockid_for_get, &ts);
ts = timespec_add (ts, timeout);
ts = timespec_add (ts, timeout);
@@ -120,7 +120,7 @@ reader_thread (void *arg)
int e;
do
{
- xclock_gettime (clockid_for_get, &ts);
+ __xclock_gettime (clockid_for_get, &ts);
ts = timespec_add (ts, timeout);
@@ -41,7 +41,7 @@ do_test_clock (clockid_t clockid)
TEST_COMPARE (TEMP_FAILURE_RETRY (sem_wait (&s)), 0);
/* We wait for half a second. */
- xclock_gettime (clockid_for_get, &ts);
+ __xclock_gettime (clockid_for_get, &ts);
ts = timespec_add (ts, __make_timespec (0, TIMESPEC_HZ/2));
errno = 0;
@@ -57,7 +57,7 @@ void test_timespec_equal_or_after_impl (const char *file, int line,
({ \
struct timespec now; \
const int saved_errno = errno; \
- xclock_gettime ((clockid), &now); \
+ __xclock_gettime ((clockid), &now); \
TEST_TIMESPEC_BEFORE ((left), now); \
errno = saved_errno; \
})
@@ -71,7 +71,7 @@ void test_timespec_equal_or_after_impl (const char *file, int line,
({ \
struct timespec now; \
const int saved_errno = errno; \
- xclock_gettime ((clockid), &now); \
+ __xclock_gettime ((clockid), &now); \
TEST_TIMESPEC_EQUAL_OR_AFTER (now, (right)); \
errno = saved_errno; \
})
@@ -21,8 +21,7 @@
#include <support/xthread.h>
void
-xclock_gettime (clockid_t clockid,
- struct timespec *ts)
+__xclock_gettime (clockid_t clockid, struct timespec *ts)
{
const int ret = clock_gettime (clockid, ts);
if (ret < 0)
@@ -20,13 +20,14 @@
#define SUPPORT_TIME_H
#include <time.h>
+#include <struct___timespec64.h>
__BEGIN_DECLS
/* The following functions call the corresponding libc functions and
terminate the process on error. */
-void xclock_gettime (clockid_t clock, struct timespec *ts);
+void __xclock_gettime (clockid_t clock, struct timespec *ts);
/* This helper can often simplify tests by avoiding an explicit
variable declaration or allowing that declaration to be const. */
@@ -34,7 +35,7 @@ void xclock_gettime (clockid_t clock, struct timespec *ts);
static inline struct timespec xclock_now (clockid_t clock)
{
struct timespec ts;
- xclock_gettime (clock, &ts);
+ __xclock_gettime (clock, &ts);
return ts;
}
@@ -61,7 +61,7 @@ run_test (clockid_t attr_clock, clockid_t wait_clock)
TEST_COMPARE (pthread_mutex_lock (&mut), EDEADLK);
struct timespec ts_timeout;
- xclock_gettime (wait_clock == CLOCK_USE_ATTR_CLOCK ? attr_clock : wait_clock,
+ __xclock_gettime (wait_clock == CLOCK_USE_ATTR_CLOCK ? attr_clock : wait_clock,
&ts_timeout);
/* Wait one second. */
@@ -52,7 +52,7 @@ do_test (void)
{
struct timespec ts;
- xclock_gettime (CLOCK_REALTIME, &ts);
+ __xclock_gettime (CLOCK_REALTIME, &ts);
xpthread_barrier_init (&b, NULL, 2);
pthread_t me = pthread_self ();