VirtualBox

Changeset 83484 in vbox for trunk


Ignore:
Timestamp:
Mar 30, 2020 2:37:26 PM (5 years ago)
Author:
vboxsync
Message:

Linux: ticketref:19312 Linux: kernel 5.6 - we need changes: make timespec case more explicit

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/time.h

    r83473 r83484  
    407407
    408408/* PORTME: Add struct timespec guard macro here. */
    409 #if defined(RTTIME_INCL_TIMESPEC) || defined(_STRUCT_TIMESPEC) || defined(_SYS__TIMESPEC_H_) || defined(TIMEVAL_TO_TIMESPEC) || defined(_TIMESPEC) \
    410  || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_))
     409/*
     410 * Starting with Linux kernel version 5.6-rc3, the _STRUCT_TIMESPEC is only defined
     411 * under !__KERNEL__ guard and _LINUX_TIME64_H does not define a corresponding
     412 * _STRUCT_TIMESPEC64. Only 64-bit time-interfaces are now allowed into the kernel.
     413 * We have to keep it for __KERNEL__ though to support older guest kernels (2.6.X)
     414 * without _LINUX_TIME64_H.
     415 */
     416#if defined(RT_OS_LINUX) && defined(_LINUX_TIME64_H)
     417#define RTTIME_NO_TIMESPEC
     418#endif
     419#if !defined(RTTIME_NO_TIMESPEC) \
     420 && (defined(RTTIME_INCL_TIMESPEC) || defined(_STRUCT_TIMESPEC) || defined(_SYS__TIMESPEC_H_) \
     421 || defined(TIMEVAL_TO_TIMESPEC) || defined(_TIMESPEC) \
     422 || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_)))
    411423/**
    412424 * Gets the time as POSIX timespec.
     
    444456#endif /* various ways of detecting struct timespec */
    445457
    446 #if defined(RT_OS_LINUX) && defined(_LINUX_TIME64_H)
    447 /*
    448  * Starting with Linux kernel version 5.6-rc3, the _STRUCT_TIMESPEC is only defined
    449  * under !__KERNEL__ guard and _LINUX_TIME64_H does not define a corresponding
    450  * _STRUCT_TIMESPEC64. Only 64-bit time-interfaces are now allowed into the kernel.
    451  */
     458#if defined(RTTIME_NO_TIMESPEC)
    452459DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTimespec64(PRTTIMESPEC pTime, const struct timespec64 *pTimeval)
    453460{
  • trunk/src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c

    r83471 r83484  
    195195# ifdef _LINUX_TIME64_H
    196196    return RTTimeSpecSetTimespec64(pTime, &Ts);
    197 #else
     197# else
    198198    return RTTimeSpecSetTimespec(pTime, &Ts);
    199 #endif
     199# endif
    200200#else   /* < 2.6.16 */
    201201    struct timeval Tv;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette