[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 09/12] linux-user: fix __NR_semtimedop undeclared err
From: |
Aleksandar Markovic |
Subject: |
[Qemu-devel] [PULL 09/12] linux-user: fix __NR_semtimedop undeclared error |
Date: |
Sun, 26 May 2019 18:19:08 +0200 |
From: Laurent Vivier <address@hidden>
In current code, __NR_msgrcv and__NR_semtimedop are supposed to be
defined if __NR_msgsnd is defined.
But linux headers 5.2-rc1 for MIPS define __NR_msgsnd without defining
__NR_semtimedop and it breaks the QEMU build.
__NR_semtimedop is defined in asm-mips/unistd_n64.h and asm-mips/unistd_n32.h
but not in asm-mips/unistd_o32.h.
Commit d9cb4336159a ("linux headers: update against Linux 5.2-rc1") has
updated asm-mips/unistd_o32.h and added __NR_msgsnd but not __NR_semtimedop.
It introduces __NR_semtimedop_time64 instead.
This patch fixes the problem by checking for each __NR_XXX symbol
before defining the corresponding syscall.
Fixes: d9cb4336159a ("linux headers: update against Linux 5.2-rc1")
Reported-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>
Signed-off-by: Aleksandar Markovic <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
Tested-by: Alex Bennée <address@hidden>
Message-Id: <address@hidden>
---
linux-user/syscall.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5521258..5e29e67 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -763,14 +763,7 @@ safe_syscall2(int, nanosleep, const struct timespec *, req,
safe_syscall4(int, clock_nanosleep, const clockid_t, clock, int, flags,
const struct timespec *, req, struct timespec *, rem)
#endif
-#ifdef __NR_msgsnd
-safe_syscall4(int, msgsnd, int, msgid, const void *, msgp, size_t, sz,
- int, flags)
-safe_syscall5(int, msgrcv, int, msgid, void *, msgp, size_t, sz,
- long, msgtype, int, flags)
-safe_syscall4(int, semtimedop, int, semid, struct sembuf *, tsops,
- unsigned, nsops, const struct timespec *, timeout)
-#else
+#if !defined(__NR_msgsnd) || !defined(__NR_msgrcv) || !defined(__NR_semtimedop)
/* This host kernel architecture uses a single ipc syscall; fake up
* wrappers for the sub-operations to hide this implementation detail.
* Annoyingly we can't include linux/ipc.h to get the constant definitions
@@ -785,14 +778,29 @@ safe_syscall4(int, semtimedop, int, semid, struct sembuf
*, tsops,
safe_syscall6(int, ipc, int, call, long, first, long, second, long, third,
void *, ptr, long, fifth)
+#endif
+#ifdef __NR_msgsnd
+safe_syscall4(int, msgsnd, int, msgid, const void *, msgp, size_t, sz,
+ int, flags)
+#else
static int safe_msgsnd(int msgid, const void *msgp, size_t sz, int flags)
{
return safe_ipc(Q_IPCCALL(0, Q_MSGSND), msgid, sz, flags, (void *)msgp, 0);
}
+#endif
+#ifdef __NR_msgrcv
+safe_syscall5(int, msgrcv, int, msgid, void *, msgp, size_t, sz,
+ long, msgtype, int, flags)
+#else
static int safe_msgrcv(int msgid, void *msgp, size_t sz, long type, int flags)
{
return safe_ipc(Q_IPCCALL(1, Q_MSGRCV), msgid, sz, flags, msgp, type);
}
+#endif
+#ifdef __NR_semtimedop
+safe_syscall4(int, semtimedop, int, semid, struct sembuf *, tsops,
+ unsigned, nsops, const struct timespec *, timeout)
+#else
static int safe_semtimedop(int semid, struct sembuf *tsops, unsigned nsops,
const struct timespec *timeout)
{
--
2.7.4
- [Qemu-devel] [PULL 00/12] MIPS queue for May 19th, 2019 - v3, Aleksandar Markovic, 2019/05/26
- [Qemu-devel] [PULL 06/12] target/mips: Refactor and fix COPY_U.<B|H|W> instructions, Aleksandar Markovic, 2019/05/26
- [Qemu-devel] [PULL 12/12] BootLinuxSshTest: Test some userspace commands on Malta, Aleksandar Markovic, 2019/05/26
- [Qemu-devel] [PULL 10/12] target/mips: add or remove space to fix checkpatch errors, Aleksandar Markovic, 2019/05/26
- [Qemu-devel] [PULL 11/12] target/mips: realign comments to fix checkpatch warnings, Aleksandar Markovic, 2019/05/26
- [Qemu-devel] [PULL 08/12] mips: Decide to map PAGE_EXEC in map_address, Aleksandar Markovic, 2019/05/26
- [Qemu-devel] [PULL 07/12] target/mips: Refactor and fix INSERT.<B|H|W|D> instructions, Aleksandar Markovic, 2019/05/26
- [Qemu-devel] [PULL 05/12] target/mips: Refactor and fix COPY_S.<B|H|W|D> instructions, Aleksandar Markovic, 2019/05/26
- [Qemu-devel] [PULL 09/12] linux-user: fix __NR_semtimedop undeclared error,
Aleksandar Markovic <=
- [Qemu-devel] [PULL 04/12] target/mips: Fix MSA instructions ST.<B|H|W|D> on big endian host, Aleksandar Markovic, 2019/05/26
- [Qemu-devel] [PULL 03/12] target/mips: Fix MSA instructions LD.<B|H|W|D> on big endian host, Aleksandar Markovic, 2019/05/26
- [Qemu-devel] [PULL 02/12] target/mips: Make the results of MOD_<U|S>.<B|H|W|D> the same as on hardware, Aleksandar Markovic, 2019/05/26
- [Qemu-devel] [PULL 01/12] target/mips: Make the results of DIV_<U|S>.<B|H|W|D> the same as on hardware, Aleksandar Markovic, 2019/05/26
- Re: [Qemu-devel] [PULL 00/12] MIPS queue for May 19th, 2019 - v3, Peter Maydell, 2019/05/28