Minor clock_getcpuclockid optimization.

Don't ask the kernel to copy data to userspace if we don't need it.
(Noticed while cleaning up sysconf to not call clock_getres.)

Change-Id: Icc0f7559775b8a2dcefe638ce831d06b75d67122
This commit is contained in:
Elliott Hughes 2016-03-07 11:54:02 -08:00
parent ba2232d013
commit 2bf5332f23
1 changed files with 1 additions and 2 deletions

View File

@ -40,8 +40,7 @@ int clock_getcpuclockid(pid_t pid, clockid_t* clockid) {
result |= 2;
// Bit 2: thread (set) or process (clear). Bit 2 already 0.
timespec ts;
if (clock_getres(result, &ts) == -1) {
if (clock_getres(result, nullptr) == -1) {
return ESRCH;
}