mirror of
git://git.musl-libc.org/musl
synced 2025-03-06 20:48:29 +01:00
fix ESRCH error handling for clock_getcpuclockid
the syscall used to probe availability of the clock fails with EINVAL when the requested pid does not exist, but clock_getcpuclockid is specified to use ESRCH for this purpose.
This commit is contained in:
parent
4f48da008d
commit
baaf257f05
1 changed files with 1 additions and 0 deletions
|
@ -8,6 +8,7 @@ int clock_getcpuclockid(pid_t pid, clockid_t *clk)
|
|||
struct timespec ts;
|
||||
clockid_t id = (-pid-1)*8U + 2;
|
||||
int ret = __syscall(SYS_clock_getres, id, &ts);
|
||||
if (ret == -EINVAL) ret = -ESRCH;
|
||||
if (ret) return -ret;
|
||||
*clk = id;
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue