kernel/clock_gettime: Various fixes.
authorSascha Wildner <saw@online.de>
Sun, 25 Sep 2016 22:36:03 +0000 (00:36 +0200)
committerSascha Wildner <saw@online.de>
Sun, 25 Sep 2016 22:36:03 +0000 (00:36 +0200)
commitc1b9c0932e482bb6a37eb190a5b504b270d2166d
tree33c3fae899992577e595731df01191030e53f85f
parent0cb0a810cb4e04b30937cb4260e779f717a86492
kernel/clock_gettime: Various fixes.

* Fix CLOCK_PROF and CLOCK_VIRTUAL to behave like FreeBSD's. They are
  not meant to return the values of ITIMER_PROF and ITIMER_VIRTUAL
  (which are decreasing, see getitimer(2)), like they were implemented
  by 91810a6f0686477493e9915e98cfc5adcbe91363. This also fixes
  CLOCK_PROCESS_CPUTIME_ID.

* Fix CLOCK_PROCESS_THREAD_ID. It was adding the values wrongly in a
  way that could cause tv_nsec to overflow (i.e. become >= 1000000000).

* Fix clock_getres() for CLOCK_{PROCESS,THREAD}_CPUTIME_ID.

* Mention CLOCK_{PROCESS,THREAD}_CPUTIME_ID in clock_gettime()'s manual
  page.

* Bring in some minor manual page fixes from FreeBSD.

Reported-by: zhtw
Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/2951>
lib/libc/sys/clock_gettime.2
sys/kern/kern_time.c