[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/4] linux-user: pass correct host flags to eventfd2
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH 2/4] linux-user: pass correct host flags to eventfd2 call |
Date: |
Fri, 12 Apr 2013 16:38:20 +0200 |
From: Petar Jovanovic <address@hidden>
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: Petar Jovanovic <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
linux-user/syscall.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index ee82a2d..1f07621 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -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)
--
1.8.1.4
- [Qemu-devel] [PULL v2 0/4] Trivial patches for 6 to 12 April 2013, Stefan Hajnoczi, 2013/04/12
- [Qemu-devel] [PATCH 1/4] target-moxie: Fix VMState registration, Stefan Hajnoczi, 2013/04/12
- [Qemu-devel] [PATCH 2/4] linux-user: pass correct host flags to eventfd2 call,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 4/4] cpu-exec: Allow "-d exec" in non-debug builds (drop CONFIG_DEBUG_EXEC), Stefan Hajnoczi, 2013/04/12
- [Qemu-devel] [PATCH 3/4] Typo, spelling and grammatical fixes, Stefan Hajnoczi, 2013/04/12
- Re: [Qemu-devel] [PULL v2 0/4] Trivial patches for 6 to 12 April 2013, Aurelien Jarno, 2013/04/13