VirtualBox

Changeset 85207 in vbox for trunk/include


Ignore:
Timestamp:
Jul 10, 2020 9:31:49 PM (5 years ago)
Author:
vboxsync
Message:

iprt/time.h: I was mistaken we actually need timespec for older kernels. Test-compiled against 4.13 (on windows ;-). bugref:9757

File:
1 edited

Legend:

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

    r85206 r85207  
    356356}
    357357
     358/** @def RTTIME_LINUX_KERNEL_PREREQ
     359 * @note Cannot really be moved to iprt/cdefs.h, see the-linux-kernel.h */
     360#if defined(RT_OS_LINUX) && defined(LINUX_KERNEL_VERSION) && defined(KERNEL_VERSION)
     361# define RTTIME_LINUX_KERNEL_PREREQ(a, b, c)    (LINUX_VERSION_CODE < KERNEL_VERSION(a,b,c))
     362#else
     363# define RTTIME_LINUX_KERNEL_PREREQ(a, b, c)    0
     364#endif
    358365
    359366/* PORTME: Add struct timeval guard macro here. */
     
    365372 || (   defined(RT_OS_LINUX) \
    366373     && defined(_LINUX_TIME_H) \
    367      && (!defined(__KERNEL__) /* || < 5.6-rc3 - but we don't need this in ring-0. @bugref{9757} */)) \
     374     && (!defined(__KERNEL__) || !RTTIME_LINUX_KERNEL_PREREQ(5,6,0)) /* @bugref{9757} */ ) \
    368375 || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_))
    369376
     
    411418 || defined(_TIMESPEC) \
    412419 || (   defined(_STRUCT_TIMESPEC) \
    413      && (!defined(RT_OS_LINUX) || !defined(__KERNEL__) /* || < 5.6-rc3 - but we don't need this in ring-0. @bugref{9757} */) ) \
     420     && (   !defined(RT_OS_LINUX) \
     421         || !defined(__KERNEL__) \
     422         || !RTTIME_LINUX_KERNEL_PREREQ(5,6,0) /* @bugref{9757} */)) \
    414423 || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_))
    415424
     
    459468 * @param   pTimespec   Where to store the time as linux 64-bit timespec.
    460469 */
    461 DECLINLINE(struct timespec64 *) RTTimeSpecSetTimespec64(PCRTTIMESPEC pTime, struct timespec64 *pTimespec)
     470DECLINLINE(struct timespec64 *) RTTimeSpecGetTimespec64(PCRTTIMESPEC pTime, struct timespec64 *pTimespec)
    462471{
    463472    int64_t i64 = RTTimeSpecGetNano(pTime);
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