提交 8ec9cf89 编写于 作者: N Nathan Froyd 提交者: Riku Voipio

linux-user: fix mq_* compilation problems

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
Signed-off-by: NRiku Voipio <riku.voipio@iki.fi>
上级 c761c154
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <fcntl.h> #include <fcntl.h>
#include <time.h> #include <time.h>
#include <limits.h> #include <limits.h>
#include <mqueue.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/ipc.h> #include <sys/ipc.h>
#include <sys/msg.h> #include <sys/msg.h>
...@@ -850,6 +849,9 @@ static inline abi_long copy_to_user_timeval(abi_ulong target_tv_addr, ...@@ -850,6 +849,9 @@ static inline abi_long copy_to_user_timeval(abi_ulong target_tv_addr,
return 0; 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, static inline abi_long copy_from_user_mq_attr(struct mq_attr *attr,
abi_ulong target_mq_attr_addr) abi_ulong target_mq_attr_addr)
{ {
...@@ -887,6 +889,7 @@ static inline abi_long copy_to_user_mq_attr(abi_ulong target_mq_attr_addr, ...@@ -887,6 +889,7 @@ static inline abi_long copy_to_user_mq_attr(abi_ulong target_mq_attr_addr,
return 0; return 0;
} }
#endif
/* do_select() must return target values and target errnos. */ /* do_select() must return target values and target errnos. */
static abi_long do_select(int n, static abi_long do_select(int n,
...@@ -6863,7 +6866,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, ...@@ -6863,7 +6866,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
break; break;
#endif #endif
#ifdef TARGET_NR_mq_open #if defined(TARGET_NR_mq_open) && defined(__NR_mq_open)
case TARGET_NR_mq_open: case TARGET_NR_mq_open:
{ {
struct mq_attr posix_mq_attr; struct mq_attr posix_mq_attr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册