summaryrefslogtreecommitdiffstats
path: root/linux-user
diff options
context:
space:
mode:
authorHelge Deller2016-12-06 16:24:03 +0100
committerRichard Henderson2017-01-23 03:14:10 +0100
commit8cb762fe013a4368fc7aa2eba27c44033ec310e0 (patch)
tree03c0f54ebc45ceb1b661e4b4cfa4c66bd7bef8f3 /linux-user
parentlinux-user: Support stack-grows-up in elfload.c (diff)
downloadqemu-8cb762fe013a4368fc7aa2eba27c44033ec310e0.tar.gz
qemu-8cb762fe013a4368fc7aa2eba27c44033ec310e0.tar.xz
qemu-8cb762fe013a4368fc7aa2eba27c44033ec310e0.zip
linux-user: Handle TIOCSTART and TIOCSTOP
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. Signed-off-by: Helge Deller <deller@gmx.de> Message-Id: <20161206152403.GA6651@ls3530> Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/ioctls.h5
-rw-r--r--linux-user/syscall.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
index 1bad701481..eaf6fe61b0 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 7b77503f94..acb004f035 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]) {