Lines 366-371
Link Here
|
366 |
* @param pTime The time spec to interpret. |
366 |
* @param pTime The time spec to interpret. |
367 |
* @param pTimeval Where to store the time as POSIX timeval. |
367 |
* @param pTimeval Where to store the time as POSIX timeval. |
368 |
*/ |
368 |
*/ |
|
|
369 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 99) |
369 |
DECLINLINE(struct timeval *) RTTimeSpecGetTimeval(PCRTTIMESPEC pTime, struct timeval *pTimeval) |
370 |
DECLINLINE(struct timeval *) RTTimeSpecGetTimeval(PCRTTIMESPEC pTime, struct timeval *pTimeval) |
370 |
{ |
371 |
{ |
371 |
int64_t i64 = RTTimeSpecGetMicro(pTime); |
372 |
int64_t i64 = RTTimeSpecGetMicro(pTime); |
Lines 392-403
Link Here
|
392 |
{ |
393 |
{ |
393 |
return RTTimeSpecAddMicro(RTTimeSpecSetSeconds(pTime, pTimeval->tv_sec), pTimeval->tv_usec); |
394 |
return RTTimeSpecAddMicro(RTTimeSpecSetSeconds(pTime, pTimeval->tv_sec), pTimeval->tv_usec); |
394 |
} |
395 |
} |
|
|
396 |
#endif |
395 |
#endif /* various ways of detecting struct timeval */ |
397 |
#endif /* various ways of detecting struct timeval */ |
396 |
|
398 |
|
397 |
|
399 |
|
398 |
/* PORTME: Add struct timespec guard macro here. */ |
400 |
/* PORTME: Add struct timespec guard macro here. */ |
399 |
#if defined(RTTIME_INCL_TIMESPEC) || defined(_STRUCT_TIMESPEC) || defined(_SYS__TIMESPEC_H_) || defined(TIMEVAL_TO_TIMESPEC) || defined(_TIMESPEC) \ |
401 |
#if defined(RTTIME_INCL_TIMESPEC) || defined(_STRUCT_TIMESPEC) || defined(_SYS__TIMESPEC_H_) || defined(TIMEVAL_TO_TIMESPEC) || defined(_TIMESPEC) \ |
400 |
|| (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_)) |
402 |
|| (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_)) |
|
|
403 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 99) |
401 |
/** |
404 |
/** |
402 |
* Gets the time as POSIX timespec. |
405 |
* Gets the time as POSIX timespec. |
403 |
* |
406 |
* |
Lines 431-446
Link Here
|
431 |
{ |
434 |
{ |
432 |
return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimespec->tv_sec), pTimespec->tv_nsec); |
435 |
return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimespec->tv_sec), pTimespec->tv_nsec); |
433 |
} |
436 |
} |
|
|
437 |
#endif |
434 |
|
438 |
|
435 |
|
439 |
|
|
|
440 |
#endif /* various ways of detecting struct timespec */ |
441 |
|
436 |
# ifdef _LINUX_TIME64_H |
442 |
# ifdef _LINUX_TIME64_H |
437 |
DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTimespec64(PRTTIMESPEC pTime, const struct timespec64 *pTimeval) |
443 |
DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTimespec64(PRTTIMESPEC pTime, const struct timespec64 *pTimeval) |
438 |
{ |
444 |
{ |
439 |
return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimeval->tv_sec), pTimeval->tv_nsec); |
445 |
return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimeval->tv_sec), pTimeval->tv_nsec); |
440 |
} |
446 |
} |
441 |
# endif |
447 |
#endif |
442 |
#endif /* various ways of detecting struct timespec */ |
|
|
443 |
|
444 |
|
448 |
|
445 |
|
449 |
|
446 |
/** The offset of the unix epoch and the base for NT time (in 100ns units). |
450 |
/** The offset of the unix epoch and the base for NT time (in 100ns units). |