#undef attribute_hidden
#define attribute_hidden
-#define __clock_gettime clock_gettime
+#define __clock_gettime __clock_gettime64
#include <hp-timing.h>
#include <stdint.h>
static inline uint32_t
random_bits (void)
{
- struct timespec tv;
- __clock_gettime (CLOCK_MONOTONIC, &tv);
+ struct __timespec64 tv;
+ __clock_gettime64 (CLOCK_MONOTONIC, &tv);
/* Shuffle the lower bits to minimize the clock bias. */
uint32_t ret = tv.tv_nsec ^ tv.tv_sec;
ret ^= (ret << 24) | (ret >> 8);
memset (ut->ut_name, '\0', sizeof ut->ut_name);
memset (ut->ut_host, '\0', sizeof ut->ut_host);
- struct timespec ts;
- __clock_gettime (CLOCK_REALTIME, &ts);
+ struct __timespec64 ts;
+ __clock_gettime64 (CLOCK_REALTIME, &ts);
TIMESPEC_TO_TIMEVAL (&ut->ut_tv, &ts);
ut->ut_type = DEAD_PROCESS;
#include <time.h>
#include <unistd.h>
#include <utmp.h>
+#include <struct___timespec64.h>
void
strncpy (ut.ut_name, name, sizeof ut.ut_name);
strncpy (ut.ut_host, host, sizeof ut.ut_host);
- struct timespec ts;
- __clock_gettime (CLOCK_REALTIME, &ts);
+ struct __timespec64 ts;
+ __clock_gettime64 (CLOCK_REALTIME, &ts);
TIMESPEC_TO_TIMEVAL (&ut.ut_tv, &ts);
updwtmp (_PATH_WTMP, &ut);
unsigned int size;
unsigned int server_used;
unsigned int current_ep;
- time_t expires;
+ __time64_t expires;
char name[];
} *nis_server_cache[16];
static time_t nis_cold_start_mtime;
static directory_obj *
nis_server_cache_search (const_nis_name name, int search_parent,
unsigned int *server_used, unsigned int *current_ep,
- struct timeval *now)
+ struct __timespec64 *now)
{
directory_obj *ret = NULL;
int i;
static void
nis_server_cache_add (const_nis_name name, int search_parent,
directory_obj *dir, unsigned int server_used,
- unsigned int current_ep, struct timeval *now)
+ unsigned int current_ep, struct __timespec64 *now)
{
struct nis_server_cache **loc;
struct nis_server_cache *new;
nis_error result = NIS_SUCCESS;
nis_error status;
directory_obj *obj;
- struct timeval now;
- struct timespec ts;
+ struct __timespec64 ts;
unsigned int server_used = ~0;
unsigned int current_ep = ~0;
if (*dir != NULL)
return NIS_SUCCESS;
- __clock_gettime (CLOCK_REALTIME, &ts);
- TIMESPEC_TO_TIMEVAL (&now, &ts);
+ __clock_gettime64 (CLOCK_REALTIME, &ts);
if ((flags & NO_CACHE) == 0)
*dir = nis_server_cache_search (name, search_parent, &server_used,
- ¤t_ep, &now);
+ ¤t_ep, &ts);
if (*dir != NULL)
{
unsigned int server_len = (*dir)->do_servers.do_servers_len;
}
if ((flags & NO_CACHE) == 0)
nis_server_cache_add (name, search_parent, obj,
- server_used, current_ep, &now);
+ server_used, current_ep, &ts);
}
else
{
vDSO symbol. */
#define HP_TIMING_NOW(var) \
({ \
- struct timespec tv; \
- __clock_gettime (CLOCK_MONOTONIC, &tv); \
+ struct __timespec64 tv; \
+ __clock_gettime64 (CLOCK_MONOTONIC, &tv); \
(var) = (tv.tv_nsec + UINT64_C(1000000000) * tv.tv_sec); \
})
#ifndef GETTIME
# define GETTIME(low,high) \
{ \
- struct timespec now; \
+ struct __timespec64 now; \
uint64_t usecs; \
- clock_gettime (CLOCK_REALTIME, &now); \
+ __clock_gettime64 (CLOCK_REALTIME, &now); \
usecs = (uint64_t)now.tv_nsec / 1000 + (uint64_t)now.tv_sec * 1000000; \
low = usecs & 0xffffffff; \
high = usecs >> 32; \
if (__glibc_unlikely (tz != 0))
memset (tz, 0, sizeof (struct timezone));
- struct timespec ts;
- __clock_gettime (CLOCK_REALTIME, &ts);
+ struct __timespec64 ts;
+ __clock_gettime64 (CLOCK_REALTIME, &ts);
*tv32 = valid_timespec_to_timeval32 (ts);
return 0;
clock_t
clock (void)
{
- struct timespec ts;
+ struct __timespec64 ts;
_Static_assert (CLOCKS_PER_SEC == 1000000,
"CLOCKS_PER_SEC should be 1000000");
- /* clock_gettime shouldn't fail here since CLOCK_PROCESS_CPUTIME_ID is
- supported since 2.6.12. Check the return value anyway in case the kernel
- barfs on us for some reason. */
- if (__glibc_unlikely (__clock_gettime (CLOCK_PROCESS_CPUTIME_ID, &ts) != 0))
+ if (__glibc_unlikely (__clock_gettime64 (CLOCK_PROCESS_CPUTIME_ID, &ts) != 0))
return (clock_t) -1;
return (ts.tv_sec * CLOCKS_PER_SEC