提交 5947c697 编写于 作者: P Petar Jovanovic 提交者: Stefan Hajnoczi

linux-user: pass correct host flags to eventfd2 call

This change makes conversion of TARGET_O_NONBLOCK and TARGET_O_CLOEXEC flags
to host flags before calling eventfd for TARGET_NR_eventfd2.
Signed-off-by: NPetar Jovanovic <petar.jovanovic@imgtec.com>
Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 183543cd
......@@ -8823,8 +8823,17 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
#endif
#if defined(TARGET_NR_eventfd2)
case TARGET_NR_eventfd2:
ret = get_errno(eventfd(arg1, arg2));
{
int host_flags = arg2 & (~(TARGET_O_NONBLOCK | TARGET_O_CLOEXEC));
if (arg2 & TARGET_O_NONBLOCK) {
host_flags |= O_NONBLOCK;
}
if (arg2 & TARGET_O_CLOEXEC) {
host_flags |= O_CLOEXEC;
}
ret = get_errno(eventfd(arg1, host_flags));
break;
}
#endif
#endif /* CONFIG_EVENTFD */
#if defined(CONFIG_FALLOCATE) && defined(TARGET_NR_fallocate)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册