[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/26] linux-user: Handle TIOCSTART and TIOCSTOP
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 03/26] linux-user: Handle TIOCSTART and TIOCSTOP |
Date: |
Fri, 16 Dec 2016 11:13:42 -0800 |
From: Helge Deller <address@hidden>
Some architectures (ppc, alpha, sparc, parisc, sh and xtensa) define the
BSD TIOCSTART and TIOCSTOP ioctls in their kernel headers to provide
compatibility to other operating systems.
Those ioctls are not implemented in Linux, nevertheless, bash will use
this ioctl if it's available on those architectures.
To avoid false warnings, add code to simply ignore those ioctls.
Cc: Riku Voipio <address@hidden>
Signed-off-by: Helge Deller <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
linux-user/ioctls.h | 5 +++++
linux-user/syscall.c | 6 ++++++
2 files changed, 11 insertions(+)
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
index 1bad701..eaf6fe6 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -422,3 +422,8 @@
MK_PTR(MK_STRUCT(STRUCT_rtentry)))
IOCTL_SPECIAL(SIOCDELRT, IOC_W, do_ioctl_rt,
MK_PTR(MK_STRUCT(STRUCT_rtentry)))
+
+#ifdef TARGET_TIOCSTART
+ IOCTL_IGNORE(TIOCSTART)
+ IOCTL_IGNORE(TIOCSTOP)
+#endif
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 7b77503..acb004f 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5453,6 +5453,8 @@ static IOCTLEntry ioctl_entries[] = {
{ TARGET_ ## cmd, cmd, #cmd, access, 0, { __VA_ARGS__ } },
#define IOCTL_SPECIAL(cmd, access, dofn, ...) \
{ TARGET_ ## cmd, cmd, #cmd, access, dofn, { __VA_ARGS__ } },
+#define IOCTL_IGNORE(cmd) \
+ { TARGET_ ## cmd, 0, #cmd },
#include "ioctls.h"
{ 0, 0, },
};
@@ -5484,6 +5486,10 @@ static abi_long do_ioctl(int fd, int cmd, abi_long arg)
#endif
if (ie->do_ioctl) {
return ie->do_ioctl(ie, buf_temp, fd, cmd, arg);
+ } else if (!ie->host_cmd) {
+ /* Some architectures define BSD ioctls in their headers
+ that are not implemented in Linux. */
+ return -TARGET_ENOSYS;
}
switch(arg_type[0]) {
--
2.9.3
- [Qemu-devel] [PATCH 00/26] New hppa-linux-user target, Richard Henderson, 2016/12/16
- [Qemu-devel] [PATCH 04/26] linux-user: Add SIOCGPGRP, SIOCGSTAMP, SIOCGSTAMPNS, Richard Henderson, 2016/12/16
- [Qemu-devel] [PATCH 05/26] linux-user: Handle ERFKILL and EHWPOISON, Richard Henderson, 2016/12/16
- [Qemu-devel] [PATCH 02/26] linux-user: Support stack-grows-up in elfload.c, Richard Henderson, 2016/12/16
- [Qemu-devel] [PATCH 08/26] linux-user: Add HPPA socket.h definitions, Richard Henderson, 2016/12/16
- [Qemu-devel] [PATCH 09/26] linux-user: Add HPPA syscall numbers, Richard Henderson, 2016/12/16
- [Qemu-devel] [PATCH 06/26] linux-user: Handle more IPV6 sockopts, Richard Henderson, 2016/12/16
- [Qemu-devel] [PATCH 03/26] linux-user: Handle TIOCSTART and TIOCSTOP,
Richard Henderson <=
- [Qemu-devel] [PATCH 14/26] linux-user: Add HPPA target_signal.h and target_cpu.h, Richard Henderson, 2016/12/16
- [Qemu-devel] [PATCH 15/26] linux-user: Add HPPA signal handling, Richard Henderson, 2016/12/16
- [Qemu-devel] [PATCH 11/26] linux-user: Add HPPA target_syscall.h, Richard Henderson, 2016/12/16
- [Qemu-devel] [PATCH 12/26] linux-user: Add HPPA definitions to syscall_defs.h, Richard Henderson, 2016/12/16
- [Qemu-devel] [PATCH 13/26] linux-user: Add HPPA target_structs.h, Richard Henderson, 2016/12/16
- [Qemu-devel] [PATCH 10/26] linux-user: Add HPPA termbits.h, Richard Henderson, 2016/12/16
- [Qemu-devel] [PATCH 16/26] linux-user: Add HPPA startup and main loop, Richard Henderson, 2016/12/16
- [Qemu-devel] [PATCH 19/26] target-hppa: Add nullification framework, Richard Henderson, 2016/12/16
- [Qemu-devel] [PATCH 22/26] target-hppa: Implement linux-user gateway page, Richard Henderson, 2016/12/16
- [Qemu-devel] [PATCH 23/26] target-hppa: Implement shifts and deposits, Richard Henderson, 2016/12/16