qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user: fix mq_* compilation problems
@ 2009-07-21 14:15 Nathan Froyd
  2009-07-21 20:46 ` Riku Voipio
  2009-07-22 16:14 ` Nathan Froyd
  0 siblings, 2 replies; 4+ messages in thread
From: Nathan Froyd @ 2009-07-21 14:15 UTC (permalink / raw)
  To: qemu-devel

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.
---
 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 7b57323..c9276f6 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,
@@ -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.2.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] linux-user: fix mq_* compilation problems
  2009-07-21 14:15 Nathan Froyd
@ 2009-07-21 20:46 ` Riku Voipio
  2009-07-22 16:14 ` Nathan Froyd
  1 sibling, 0 replies; 4+ messages in thread
From: Riku Voipio @ 2009-07-21 20:46 UTC (permalink / raw)
  To: Nathan Froyd; +Cc: qemu-devel

On Tue, Jul 21, 2009 at 07:15:15AM -0700, Nathan Froyd wrote:
> 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.

Looks fine to me. I'll include in my next batch for pulling if nobody
commits it before.

Acked-By: Riku Voipio <riku.voipio@iki.fi>

> ---
>  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 7b57323..c9276f6 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,
> @@ -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.2.4
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] linux-user: fix mq_* compilation problems
  2009-07-21 14:15 Nathan Froyd
  2009-07-21 20:46 ` Riku Voipio
@ 2009-07-22 16:14 ` Nathan Froyd
  1 sibling, 0 replies; 4+ messages in thread
From: Nathan Froyd @ 2009-07-22 16:14 UTC (permalink / raw)
  To: qemu-devel

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 <froydnj@codesourcery.com
---
 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 7b57323..c9276f6 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,
@@ -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.2.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH] linux-user: fix mq_* compilation problems
@ 2009-08-03 14:32 Nathan Froyd
  0 siblings, 0 replies; 4+ messages in thread
From: Nathan Froyd @ 2009-08-03 14:32 UTC (permalink / raw)
  To: qemu-devel

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 <froydnj@codesourcery.com>
---
 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 <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,
@@ -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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-08-03 14:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-03 14:32 [Qemu-devel] [PATCH] linux-user: fix mq_* compilation problems Nathan Froyd
  -- strict thread matches above, loose matches on Subject: below --
2009-07-21 14:15 Nathan Froyd
2009-07-21 20:46 ` Riku Voipio
2009-07-22 16:14 ` Nathan Froyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).