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:
parent
ba2232d013
commit
2bf5332f23
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue