/*************************************************************** SYS-CLOCK_GETRES.C This file contains Linux/i386/ILP32 implementation of __cpu_sys_clock_getres(). PART OF : CPU - library . USAGE : Internal only . Copyright (C) 2026 by Andrew V.Kosteltsev. All Rights Reserved. ***************************************************************/ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "cpu-time-linux.h" __mpu_int64_t __cpu_sys_clock_getres( __mpu_uint64_t clockid, struct __cpu_timespec *res ) { struct timespec ts; clockid_t host_clockid; int error; error = __cpu_clockid_to_host( clockid, &host_clockid ); if( error ) return( -(__mpu_int64_t)error ); if( clock_getres( host_clockid, res ? &ts : (struct timespec *)0 ) < 0 ) return( -(__mpu_int64_t)__cpu_errno_from_host( errno ) ); if( res ) { error = __cpu_timespec_from_host( res, &ts ); if( error ) return( -(__mpu_int64_t)error ); } return( 0 ); } /* End of __cpu_sys_clock_getres() */