From patchwork Thu Aug 13 20:06:18 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 31357 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 51D8FB7067 for ; Fri, 14 Aug 2009 06:15:19 +1000 (EST) Received: from localhost ([127.0.0.1]:50175 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mbghg-00010u-MG for incoming@patchwork.ozlabs.org; Thu, 13 Aug 2009 16:15:16 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MbgZH-0003zD-Lv for qemu-devel@nongnu.org; Thu, 13 Aug 2009 16:06:35 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MbgZE-0003t5-SN for qemu-devel@nongnu.org; Thu, 13 Aug 2009 16:06:33 -0400 Received: from [199.232.76.173] (port=50652 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbgZE-0003st-Ir for qemu-devel@nongnu.org; Thu, 13 Aug 2009 16:06:32 -0400 Received: from [84.20.150.76] (port=34712 helo=naru.obs2.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MbgZD-0000qG-VI for qemu-devel@nongnu.org; Thu, 13 Aug 2009 16:06:32 -0400 Received: from kos.to (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by narury.org (Postfix) with ESMTP id 3A50E327406C; Thu, 13 Aug 2009 23:06:26 +0300 (EEST) Received: by kos.to (Postfix, from userid 573) id D3A44EE831C; Thu, 13 Aug 2009 23:06:25 +0300 (EEST) From: riku.voipio@iki.fi To: qemu-devel@nongnu.org Date: Thu, 13 Aug 2009 23:06:18 +0300 Message-Id: <37ee325f7f7c0f027fea912457b142d391690622.1250193231.git.riku.voipio@iki.fi> X-Mailer: git-send-email 1.6.2.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 Cc: Riku Voipio , Nathan Froyd Subject: [Qemu-devel] [PATCH 05/11] linux-user: fix mq_* compilation problems X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Nathan Froyd 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(-) 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 #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, @@ -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;