提交 8aeee8db 编写于 作者: R Rich Felker

timedwait: play it safe for now

it's unclear whether EINVAL or ENOSYS is used when the operation is
not supported, so check for both...
上级 4f5ba921
...@@ -16,7 +16,7 @@ static int do_wait(volatile int *addr, int val, clockid_t clk, const struct time ...@@ -16,7 +16,7 @@ static int do_wait(volatile int *addr, int val, clockid_t clk, const struct time
if (clk == CLOCK_REALTIME) flag = FUTEX_CLOCK_REALTIME; if (clk == CLOCK_REALTIME) flag = FUTEX_CLOCK_REALTIME;
if (cp) r = -__syscall_cp(SYS_futex, addr, FUTEX_WAIT_BITSET|flag, val, at, 0, -1); if (cp) r = -__syscall_cp(SYS_futex, addr, FUTEX_WAIT_BITSET|flag, val, at, 0, -1);
else r = -__syscall(SYS_futex, addr, FUTEX_WAIT_BITSET|flag, val, at, 0, -1); else r = -__syscall(SYS_futex, addr, FUTEX_WAIT_BITSET|flag, val, at, 0, -1);
if (r != EINVAL) goto done; if (r != EINVAL && r != ENOSYS) goto done;
} }
if (clock_gettime(clk, &to)) return EINVAL; if (clock_gettime(clk, &to)) return EINVAL;
to.tv_sec = at->tv_sec - to.tv_sec; to.tv_sec = at->tv_sec - to.tv_sec;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册