HomeFreeBSD

Fix clock_gettime() and clock_getres() for cpu clocks:

Description

Fix clock_gettime() and clock_getres() for cpu clocks:

  • handle the CLOCK_{PROCESS,THREAD}_CPUTIME_ID specified directly;
  • fix thread id calculation as in the Linuxulator we should convert the user supplied thread id to struct thread * by linux_tdfind();
  • fix CPUCLOCK_SCHED case by using kern_{process,thread}_cputime() directly as native get_cputime() used by kern_clock_gettime() uses native tdfind()/pfind() to find proccess/thread.

PR: 240990
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D23341
MFC after: 2 weeks

Details