[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/11] linux-user: fix mq_* compilation problems
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PATCH 05/11] linux-user: fix mq_* compilation problems |
Date: |
Thu, 13 Aug 2009 23:06:18 +0300 |
From: Nathan Froyd <address@hidden>
mqueue.h is only available if __NR_mq_open is defined. So don't include
it unconditionally. Similarly, the mq_* family of syscalls depend on
__NR_mq_open. Finally, the copy_{from,to}_user_mq_attr functions should
not be defined unconditionally, but only if we're going to use the mq_*
syscalls.
Signed-off-by: Nathan Froyd <address@hidden
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/syscall.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index fdd46ec..c14a78a 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -28,7 +28,6 @@
#include <fcntl.h>
#include <time.h>
#include <limits.h>
-#include <mqueue.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
@@ -847,6 +846,9 @@ static inline abi_long copy_to_user_timeval(abi_ulong
target_tv_addr,
return 0;
}
+#if defined(TARGET_NR_mq_open) && defined(__NR_mq_open)
+#include <mqueue.h>
+
static inline abi_long copy_from_user_mq_attr(struct mq_attr *attr,
abi_ulong target_mq_attr_addr)
{
@@ -884,6 +886,7 @@ static inline abi_long copy_to_user_mq_attr(abi_ulong
target_mq_attr_addr,
return 0;
}
+#endif
/* do_select() must return target values and target errnos. */
static abi_long do_select(int n,
@@ -6860,7 +6863,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
break;
#endif
-#ifdef TARGET_NR_mq_open
+#if defined(TARGET_NR_mq_open) && defined(__NR_mq_open)
case TARGET_NR_mq_open:
{
struct mq_attr posix_mq_attr;
--
1.6.2.1
- [Qemu-devel] [PATCH 00/11] linux-user patches for HEAD, riku . voipio, 2009/08/13
- [Qemu-devel] [PATCH 02/11] m68k,linux-user: add setup_frame, riku . voipio, 2009/08/13
- [Qemu-devel] [PATCH 01/11] linux-user: add eventfd support, riku . voipio, 2009/08/13
- [Qemu-devel] [PATCH 04/11] m68k, linux-user: enable sigaltstack(), riku . voipio, 2009/08/13
- [Qemu-devel] [PATCH 03/11] m68k, linux-user: add setup_rt_frame, riku . voipio, 2009/08/13
- [Qemu-devel] [PATCH 05/11] linux-user: fix mq_* compilation problems,
riku . voipio <=
- [Qemu-devel] [PATCH 11/11] linux-user: Rewrite mmap_find_vma() to work fine on 64-bit hosts with 32-bit targets, riku . voipio, 2009/08/13
- [Qemu-devel] [PATCH 06/11] linux-user: fcntl fixes for LTP, riku . voipio, 2009/08/13
- [Qemu-devel] [PATCH 10/11] linux-user: zero fstat buffer to initialize nsec fields, riku . voipio, 2009/08/13
- [Qemu-devel] [PATCH 07/11] linux-user: enable getdents for > 32-bit systems, riku . voipio, 2009/08/13
- [Qemu-devel] [PATCH 09/11] linux-user: fadvise64 implementation, riku . voipio, 2009/08/13
- [Qemu-devel] [PATCH 08/11] linux-user: define a couple of syscalls for non-uid16 targets, riku . voipio, 2009/08/13