@@ -25,11 +25,11 @@
#include "intprops.h"
-struct timespec
-__timespec_add (struct timespec a, struct timespec b)
+struct __timespec64
+__timespec_add (struct __timespec64 a, struct __timespec64 b)
{
- time_t rs = a.tv_sec;
- time_t bs = b.tv_sec;
+ __time64_t rs = a.tv_sec;
+ __time64_t bs = b.tv_sec;
int ns = a.tv_nsec + b.tv_nsec;
int nsd = ns - TIMESPEC_HZ;
int rns = ns;
@@ -37,7 +37,7 @@ __timespec_add (struct timespec a, struct timespec b)
if (0 <= nsd)
{
rns = nsd;
- time_t bs1;
+ __time64_t bs1;
if (!INT_ADD_WRAPV (bs, 1, &bs1))
bs = bs1;
else if (rs < 0)
@@ -26,21 +26,21 @@
#include "intprops.h"
-struct timespec
-__timespec_sub (struct timespec a, struct timespec b)
+struct __timespec64
+__timespec_sub (struct __timespec64 a, struct __timespec64 b)
{
- time_t rs = a.tv_sec;
- time_t bs = b.tv_sec;
+ __time64_t rs = a.tv_sec;
+ __time64_t bs = b.tv_sec;
int ns = a.tv_nsec - b.tv_nsec;
int rns = ns;
if (ns < 0)
{
rns = ns + TIMESPEC_HZ;
- time_t bs1;
+ __time64_t bs1;
if (!INT_ADD_WRAPV (bs, 1, &bs1))
bs = bs1;
- else if (- TYPE_SIGNED (time_t) < rs)
+ else if (- TYPE_SIGNED (__time64_t) < rs)
rs--;
else
goto low_overflow;
@@ -51,12 +51,12 @@ __timespec_sub (struct timespec a, struct timespec b)
if (0 < bs)
{
low_overflow:
- rs = TYPE_MINIMUM (time_t);
+ rs = TYPE_MINIMUM (__time64_t);
rns = 0;
}
else
{
- rs = TYPE_MAXIMUM (time_t);
+ rs = TYPE_MAXIMUM (__time64_t);
rns = TIMESPEC_HZ - 1;
}
}
@@ -22,14 +22,14 @@
void
test_timespec_before_impl (const char *file, int line,
- const struct timespec left,
- const struct timespec right)
+ const struct __timespec64 left,
+ const struct __timespec64 right)
{
if (left.tv_sec > right.tv_sec
|| (left.tv_sec == right.tv_sec
&& left.tv_nsec > right.tv_nsec)) {
support_record_failure ();
- const struct timespec diff = __timespec_sub (left, right);
+ const struct __timespec64 diff = __timespec_sub (left, right);
printf ("%s:%d: %jd.%09jds not before %jd.%09jds "
"(difference %jd.%09jds)\n",
file, line,
@@ -41,14 +41,14 @@ test_timespec_before_impl (const char *file, int line,
void
test_timespec_equal_or_after_impl (const char *file, int line,
- const struct timespec left,
- const struct timespec right)
+ const struct __timespec64 left,
+ const struct __timespec64 right)
{
if (left.tv_sec < right.tv_sec
|| (left.tv_sec == right.tv_sec
&& left.tv_nsec < right.tv_nsec)) {
support_record_failure ();
- const struct timespec diff = __timespec_sub (right, left);
+ const struct __timespec64 diff = __timespec_sub (right, left);
printf ("%s:%d: %jd.%09jds not after %jd.%09jds "
"(difference %jd.%09jds)\n",
file, line,
@@ -23,10 +23,11 @@
#include <time.h>
#include <support/check.h>
#include <support/xtime.h>
+#include <struct___timespec64.h>
-struct timespec __timespec_add (struct timespec, struct timespec)
+struct __timespec64 __timespec_add (struct __timespec64, struct __timespec64)
__attribute__((const));
-struct timespec __timespec_sub (struct timespec, struct timespec)
+struct __timespec64 __timespec_sub (struct __timespec64, struct __timespec64)
__attribute__((const));
static inline struct __timespec64
@@ -41,12 +42,12 @@ __make_timespec (__time64_t s, long int ns)
enum { TIMESPEC_HZ = 1000000000 };
void test_timespec_before_impl (const char *file, int line,
- const struct timespec left,
- const struct timespec right);
+ const struct __timespec64 left,
+ const struct __timespec64 right);
void test_timespec_equal_or_after_impl (const char *file, int line,
- const struct timespec left,
- const struct timespec right);
+ const struct __timespec64 left,
+ const struct __timespec64 right);
/* Check that the timespec on the left represents a time before the
time on the right. */
@@ -55,7 +56,7 @@ void test_timespec_equal_or_after_impl (const char *file, int line,
#define TEST_TIMESPEC_BEFORE_NOW(left, clockid) \
({ \
- struct timespec now; \
+ struct __timespec64 now; \
const int saved_errno = errno; \
__xclock_gettime ((clockid), &now); \
TEST_TIMESPEC_BEFORE ((left), now); \
@@ -69,7 +70,7 @@ void test_timespec_equal_or_after_impl (const char *file, int line,
#define TEST_TIMESPEC_NOW_OR_AFTER(clockid, right) \
({ \
- struct timespec now; \
+ struct __timespec64 now; \
const int saved_errno = errno; \
__xclock_gettime ((clockid), &now); \
TEST_TIMESPEC_EQUAL_OR_AFTER (now, (right)); \