summaryrefslogtreecommitdiff
path: root/term.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2015-01-19 18:44:21 +0000
committerDmitry V. Levin <ldv@altlinux.org>2015-01-20 00:28:10 +0000
commitc7afb4881f14e44968f3a78ae5988f04ecc66b68 (patch)
tree7c55db50831c980b623a939a7e119096e035d89b /term.c
parent74932976ba16aee08b49e5ca0669dc4c6305405f (diff)
downloadstrace-c7afb4881f14e44968f3a78ae5988f04ecc66b68.tar.gz
ioctl: assume that all ioctl commands have unsigned int type
In linux, ioctl command number has a 32-bit unsigned integer type: fs/ioctl.c:SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg) If the kernel completely ignores other bits on 64-bit architectures, why should strace care? Let's follow the kernel and treat it as unsigned int. * defs.h (struct_ioctlent): Change "code" type to "unsigned int". (ioctl_decode, ioctl_lookup, block_ioctl, loop_ioctl, mtd_ioctl, ubi_ioctl, ptp_ioctl, scsi_ioctl, sock_ioctl, term_ioctl, rtc_ioctl, v4l2_ioctl): Likewise. * ioctl.c (ioctl_decode, ioctl_lookup, compare, ioctl_next_match): Likewise. * block.c (block_ioctl): Likewise. * loop.c (loop_ioctl): Likewise. * mtd.c (mtd_ioctl, ubi_ioctl): Likewise. * ptp.c (ptp_ioctl): Likewise. * scsi.c (scsi_ioctl): Likewise. * sock.c (sock_ioctl): Likewise. * term.c (term_ioctl): Likewise. * time.c (rtc_ioctl): Likewise. * v4l2.c (v4l2_ioctl): Likewise. * ioctlsort.c (struct ioctlent, compare, main): Likewise.
Diffstat (limited to 'term.c')
-rw-r--r--term.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/term.c b/term.c
index d1c9b6530..b2811f27a 100644
--- a/term.c
+++ b/term.c
@@ -44,7 +44,8 @@
#include "xlat/baud_options.h"
#include "xlat/modem_flags.h"
-int term_ioctl(struct tcb *tcp, long code, long arg)
+int
+term_ioctl(struct tcb *tcp, const unsigned int code, long arg)
{
struct termios tios;
struct termio tio;