From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MXygn-0004d5-Rq for qemu-devel@nongnu.org; Mon, 03 Aug 2009 10:39:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MXygj-0004Yd-EK for qemu-devel@nongnu.org; Mon, 03 Aug 2009 10:39:01 -0400 Received: from [199.232.76.173] (port=44194 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXygi-0004YV-VO for qemu-devel@nongnu.org; Mon, 03 Aug 2009 10:38:57 -0400 Received: from mx20.gnu.org ([199.232.41.8]:47124) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MXygi-0004m3-Ke for qemu-devel@nongnu.org; Mon, 03 Aug 2009 10:38:56 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MXygh-00010j-Ox for qemu-devel@nongnu.org; Mon, 03 Aug 2009 10:38:56 -0400 From: Nathan Froyd Date: Mon, 3 Aug 2009 07:32:13 -0700 Message-Id: <1249309933-4619-1-git-send-email-froydnj@codesourcery.com> Subject: [Qemu-devel] [PATCH] linux-user: fix mq_* compilation problems List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 --- linux-user/syscall.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) v2: resent, including Signed-off-by this time. diff --git a/linux-user/syscall.c b/linux-user/syscall.c index b5f669e..b894211 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -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 + 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, @@ -6851,7 +6854,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.3.2