History log of /external/strace/ioctl.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
b755614143ce6aab5265ed32c1bb6c8f748e7898 21-Feb-2018 Elliott Hughes <enh@google.com> Update strace to 4.21.

Noteworthy changes in release 4.21 (2018-02-13)
===============================================

* Changes in behaviour
* Warning is now issued when -F option is used.
* Warning is now issued when a tracee with unsupported personality
is attached.
* Unknown syscall numbers are now printed in hexadecimal form.

* Improvements
* Implemented decoding of netlink descriptor attributes as file descriptors.
* Implemented decoding of hugetlb page size selection flags.
* Implemented decoding of BPF_PROG_TEST_RUN, BPF_PROG_GET_NEXT_ID,
BPF_MAP_GET_NEXT_ID, BPF_PROG_GET_FD_BY_ID, BPF_MAP_GET_FD_BY_ID,
and BPF_OBJ_GET_INFO_BY_FD commands of bpf syscall.
* Enhanced decoding of get_thread_area, memfd_create, modify_ldt,
perf_event_open, reboot, s390_guarded_storage, s390_pcio_mmio_read,
s390_pci_mmio_write, s390_runtime_instr, s390_sthyi, set_thread_area,
and shmget syscalls.
* Implemented decoding of KVM_* and DM_LIST_DEVICES ioctl commands.
* Implemented decoding of riscv_flush_icache syscall.
* Enhanced decoding of getsockopt and setsockopt syscalls for SOL_NETLINK
level.
* Enhanced decoding of BPF_MAP_CREATE command of bpf syscall.
* Print values returned by mq_open syscall and first arguments
of mq_getsetattr, mq_notify, mq_timedreceive, and mq_timedsend syscalls
as file descriptors.
* Added decoding of get_tls syscall on arm.
* Added -e trace=%pure option for tracing system calls with no arguments that
never fail.
* Updated lists of IPV6_*, MAP_*, MEMBARRIER_CMD_*, MSG_*, NT_*, PKEY_*,
SHM_*, and TCP_* constants.
* Added manual page for the strace-log-merge command.
* Updated lists of ioctl commands from Linux 4.15.
* Implemented biarch support for s390x.
* Implemented an optional support for symbol demangling in strace -k output
(activated by --with-libiberty configure option).
* Information about availability of demangling and reliable personality
decoding (on architectures with multiple personalities) is now available
in strace -V output.
* Added decoding of pkey_alloc, pkey_free, and pkey_mprotect syscalls on
powerpc and powerpc64.
* Enhanced manual page.

* Bug fixes
* Fixed multi-personality support in cross builds.
* Added mq_getsetattr, mq_notify, mq_open, mq_timedreceive, and mq_timedsend
syscalls to %desc tracing set.
* Fixed path tracing support for mmap syscalls with indirect arguments and
for old select syscall.
* Fixed decoding of arm-specific (__ARM_NR_*) syscalls.
* Fixed open mode flags decoding.
* Fixed corner cases in handling of strace -ff -ttt logs by strace-log-merge.
* Error counts that exceed one billion are now printed correctly in call
summary output.
* Fixed call summary header for x32 personality.
* Changes of tracee personalities are reported more reliably.
* Fixed the case when strace attaches to a tracee being inside exec and its
first syscall stop is syscall-exit-stop instead of syscall-enter-stop,
which messed up all the syscall state tracking.
* Fixed printing of higher 32 bits of the return value for x32 personality.

* Portability
* A C compiler that supports "for" loop initial declarations is now required.
* Inability to configure multiple personality support on architectures where
multiple personalities are supported leads to configuration failure during
build now. Use --enable-mpers=check to revert to the old behaviour.
* Build-time requirement for the mpers support has been lowered from gawk 4
to gawk 3.
* Removed incomplete and non-functional support for the CRIS architecture.
* Removed incomplete and unused support for IA-32 mode on the IA-64
architecture.

Bug: N/A
Test: strace -f date
Change-Id: I126eec18d7309a89f5a75dcab6498c99bb099836
/external/strace/ioctl.c
77c3ff8e0644f1e120e4b2ebc7222150b0446f3b 09-Sep-2017 Elliott Hughes <enh@google.com> Update strace to 4.19.

Noteworthy changes in release 4.19 (2017-09-05)
===============================================

* Changes in behaviour
* Changed formatting of personality names on tile architecture in order
to make it in line with other multi-personality architectures.
* Changed field output order in struct v4l2_requestbuffers to improve in/out
field formatting.
* Changed handling of multiple signal= specifications in an injection
expression: multiple specification now leads to error instead of implicit
usage the last specification.

* Improvements
* Enhanced decoding of optlen argument of getsockopt syscall.
* Enhanced decoding of SO_LINGER option of getsockopt and setsockopt syscalls.
* Enhanced decoding of SO_PEERCRED option of getsockopt syscall.
* Enhanced decoding of IP_ADD_MEMBERSHIP, IP_DROP_MEMBERSHIP,
IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP, IPV6_JOIN_ANYCAST,
IPV6_LEAVE_ANYCAST, MCAST_JOIN_GROUP, and MCAST_LEAVE_GROUP options
of setsockopt syscall.
* Enhanced decoding of KEYCTL_DH_COMPUTE operation of keyctl syscall
(KDF parameters decoding).
* Implemented decoding of KEYCTL_RESTRICT_KEYRING operation of keyctl syscall.
* Enhanced decoding of UFFDIO_API ioctl command.
* Enhanced decoding of BPF_PROG_LOAD, BPF_MAP_CREATE, BPF_MAP_LOOKUP_ELEM,
and BPF_MAP_GET_NEXT_KEY commands of bpf syscall.
* Implemented decoding of linux socket filter programs specified
for SO_ATTACH_FILTER and SO_ATTACH_REUSEPORT_CBPF socket options.
* Implemented decoding of inet_diag_req_v2, inet_diag_req_compat,
packet_diag_msg, and smc_diag_msg netlink attributes of NETLINK_SOCK_DIAG.
* Implemented NETLINK_SELINUX protocol specific decoding.
* Implemented decoding of netlink message ack flags.
* Implemented decoding of nlmsgerr netlink attributes.
* Implemented basic protocol specific decoding of NETLINK_CRYPTO.
* Implemented decoding of crypto_user_alg netlink attributes
of NETLINK_CRYPTO.
* Implemented basic protocol specific decoding of addr, addrlabel, dcb, link,
mdb, neigh, neightbl, netconf, nsid, route, rule, tc, and tca messages
of NETLINK_ROUTE.
* Implemented decoding of NETLINK_KOBJECT_UEVENT messages.
* Improved handling of unexpected tracees (the ones that cloned with
CLONE_PARENT/CLONE_PTRACE or called PTRACE_TRACEME on themselves): they
are now PTRACE_DETACH'ed instead of PTRACE_CONT'ed.
* Updated lists of BPF_*, KEY_*, RWF_*, SCM_*, SO_*, and *_MAGIC constants.
* Added decoding of arch_prctl syscall on x86.
* Added decoding of seccomp, bpf, userfaultfd, membarrier, mlock2,
copy_file_range, preadv2, pwritev2, and statx on alpha.
* Added decoding of statx syscall on microblaze.
* Added decoding of s390_guarded_storage syscall on s390.
* Updated lists of ioctl commands from Linux 4.13.
* Enhanced manual page.

* Bug fixes
* Fixed printing of group_req structure on non-native personalities.
* Fixed output formatting of blkpg_ioctl_arg, dm_name_list, and iocb
structures.
* Fixed formatting of nul-terminated strings which have kernel-imposed size
limit.
* Fixed printing of paths that hit PATM_MAX limit in order to match kernel's
behaviour.
* Fixed build warnings on Android mips64.
* Fixed unused function "is_negated_errno" build warning when built
with clang.
* Fixed syscall number and arguments retrieval behaviour on sparc64 and
mips o32 after prctl(PR_SET_DUMPABLE, 0) makes PTRACE_PEEKTEXT impossible
to use if Linux kernel has commit v4.10-rc1~114^2~2.
* Fixed path tracing for execveat, symlink, symlinkat, inotify_add_watch,
and inotify_init syscalls.
* Fixed personality switch printing on sparc64 and risc-v.

Bug: N/A
Test: strace date
Change-Id: Idd0ba3efc3fe14dad8aa7b3859045b00d4e6749d
/external/strace/ioctl.c
39bac055674d23770b9a724221b728e443196ea7 26-May-2017 Elliott Hughes <enh@google.com> Upgrade strace to 4.17.

Noteworthy changes in release 4.17 (2017-05-24)
===============================================

* Changes in command line syntax
* Syscall classes specified in -e trace= option now have % prefix (like
-e trace=%process). Old style class names without leading % are still
supported, but considered deprecated now.

* Improvements
* Optimized syscall filtering.
* Improved representation of timestamps.
* Enhanced decoding of sched_setattr syscall.
* Added -e trace=%stat option for tracing variants of stat syscall.
* Added -e trace=%lstat option for tracing variants of lstat syscall.
* Added -e trace=%fstat option for tracing variants of fstat and fstatat
syscalls.
* Added -e trace=%%stat option for tracing syscalls used for querying file
status information (stat, lstat, fstat, fstatat, statx, and their
variations).
* Added -e trace=%statfs option for tracing statfs, statfs64 and statvfs
syscalls.
* Added -e trace=%fstatfs option for tracing fstatfs, fstatfs64 and fstatvfs
syscalls.
* Added -e trace=%%statfs option for tracing syscalls used for querying file
system statistics information (statfs-like, fstatfs-like and ustat).
* Added -e trace=/regex option for filtering syscalls using regular
expressions.
* Added support for prepending of question mark before syscall qualification
in -e trace expressions in order to suppress error in case no syscalls
matched the provided qualification.
* Implemented decoding of signal mask in rt_sigreturn syscall on alpha, arc,
arm, avr32, bfin, cris, hppa, m68k, metag, microblaze, mips, nios2, or1k,
powerpc, powerpc64, riscv, sh, sh64, sparc, sparc64, tile, x86, and xtensa
architectures.
* Implemented decoding of statx syscall.
* Implemented decoding of NS_* ioctl commands.
* Implemented decoding of the remaining V4L2_BUF_TYPE_* types.
* Implemented decoding of VIDIOC_[SG]_TUNER ioctl commands.
* Implemented decoding of NLMSG_ERROR netlink messages.
* Improved decoding of BPF_PROG_ATTACH command of bpf syscall.
* Improved decoding of misplaced parts in DM_* ioctl commands.
* Updated lists of ioctl commands from Linux 4.11.

* Bug fixes
* Fixed decoding of flags argument of preadv2 and pwritev2 syscalls on x32.
* Fixed the number of arguments and tracing flags of alpha specific syscalls.
* Fixed decoding of old sigsuspend syscall on alpha, cris, mips, powerpc,
powerpc64, sh, sh64, sparc, and sparc64.
* Fixed decoding of sgetmask and ssetmask syscalls on 64-bit architectures.
* Fixed decoding of netlink messages received within struct msghdr.
* Worked around a bug in miscompiled aarch64 kernels leading to the 3rd
argument of sched_getattr syscall being not quite 32-bit.
* Fixed corner cases of printing inaccessible times argument of utimes
and futimesat syscalls.

Bug: N/A
Test: strace date
Change-Id: Idc4614a3f16ffe57fdca2a07a05253900d1c52bb
/external/strace/ioctl.c
d35df493b4e7684c50d2d2fa032ee3a7ac228009 16-Feb-2017 Elliott Hughes <enh@google.com> Upgrade strace to 4.16 from 4.14.

Noteworthy changes in release 4.16 (2017-02-14)

* Improvements
* Implemented syscall return value injection (-e inject=SET:retval= option).
* Implemented signal injection (-e inject=SET:signal= option).
* Implemented decoding of SUID_DUMP_* constants in PR_[GS]ET_DUMPABLE.
* Implemented decoding of all SG_* ioctl commands.
* Implemented decoding of ustat syscall.
* Implemented decoding of BPF_OBJ_PIN, BPF_OBJ_GET, BPF_PROG_ATTACH,
and BPF_PROG_DETACH commands of bpf syscall.
* Enhanced decoding of sg_io_hdr and sg_io_v4 structures.
* Enhanced decoding of get_robust_list, getrandom, io_submit, set_robust_list
syscalls.
* Enhanced decoding of entities of kernel long type on x32 and mips n32 ABIs.
* Updated lists of IP_*, IPV6_*, and LOOP_* constants.
* Updated lists of ioctl commands from Linux 4.10.
* Added decoding of recently added syscalls on avr32, microblaze, ppc,
and ppc64.

* Bug fixes
* Fixed pathmatch of oldselect syscall on 64-bit architectures.
* Fixed decoding of mmap2 syscall on s390 when arguments are not available.
* Fixed decoding of kexec_file_load, mprotect, pkey_mprotect, prctl, preadv*,
and pwritev* syscalls on x32.
* Fixed printing of string arguments of getxattr and setxattr syscalls
when -s option is used to limit the printed string size.
* Fixed decoding of ifconf, ifreq, and loop_info structures on non-native
personalities.
* Fixed decoding of SG_* and LOOP_* ioctl commands.
* Fixed build on mips with musl libc.
* Fixed cross-building of ioctlsort.
* Applied minor formatting fixes to the manual page.

Noteworthy changes in release 4.15 (2016-12-14)

* Changes in behavior
* Time stamps are now printed according to ISO 8601.
* Changed output format of val3 parameter of futex FUTEX_WAKE_OP operation.
* The last argument of mincore, sched_getaffinity, and sched_setaffinity
syscalls is now formatted as an array.

* Improvements
* Implemented syscall fault injection (-e fault=... option).
* Implemented decoding of DM_* ioctl commands.
* Implemented decoding of attr parameter of perf_event_open syscall.
* Implemented decoding of pkey_alloc, pkey_free, and pkey_mprotect syscalls.
* Implemented dumping of mq_timedsend and mq_timedreceive syscalls.
* Implemented decoding of PR_SET_FP_MODE and PR_GET_FP_MODE operations
of prctl syscall.
* Implemented PTRACE_GETREGS API support on m68k.
* Updated lists of ARCH_*, BPF_*, BTRFS_*, FALLOC_*, MS_*, *_MAGIC,
and V4L2_* constants.
* Updated lists of ioctl commands from Linux 4.9.
* Added decoding of recently added syscalls on arc, x32, and xtensa.
* Enhanced manual page.

* Bug fixes
* Fixed corner cases in decoding of exit, exit_group, futimesat, getgroups,
getresuid, init_module, inotify_init1, kcmp, kexec_load, lookup_dcookie,
mq_getsetattr, mq_notify, mq_open, mq_timedreceive, mq_timedsend,
name_to_handle_at, prctl, process_vm_readv, process_vm_writev, setfsuid,
setgroups, setns, unshare, and utimes syscalls.
* Fixed handling of verbose flag in printing of controls array
of struct v4l2_ext_controls.
* Fixed omission of field names in the output of capability, sigaction,
sigevent, statfs, timespec, timeval, and utimbuf structures.
* Fixed printing of unknown syscalls in siginfo structure.
* Fixed decoding of ioctl constants on m68k.
* Fixed cris architecture support.
* Fixed cross build when host compiler does not support the same
set of warning flags as the cross compiler.
* Fixed build on SLE10 and SLE11.

Bug: N/A
Test: manual
Change-Id: I590bf5db1652aa1dfdc0eb16e30fd97c82af2261
/external/strace/ioctl.c
1f1559e6a95678d02bd62d21c927b8788bfaaffb 27-May-2016 Dmitry V. Levin <ldv@altlinux.org> ioctl.c: fix typo in decoding of EVIOCSABS's parameter

* ioctl.c (evdev_decode_number): Fix typo in printxval default value.
/external/strace/ioctl.c
4dd9f3f038683e9b3b92539c204d6009121dd77a 26-May-2016 Dmitry V. Levin <ldv@altlinux.org> Move parser of 'X' type ioctls to a separate file

* fs_x_ioctl.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* block.c: (block_ioctl): Move parser of FITRIM, FIFREEZE, and FITHAW
to fs_x_ioctl.c.
* defs.h (fs_x_ioctl): New prototype.
* ioctl.c (ioctl_decode): Call fs_x_ioctl for ioctl type 'X'.
/external/strace/ioctl.c
b3f00403c30e2c268d4a7b8d8b37e26f32f41d78 26-May-2016 Dmitry V. Levin <ldv@altlinux.org> Move parser of HDIO_* ioctls to a separate file

* hdio.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* block.c: Do not include <linux/hdreg.h>.
(block_ioctl): Move parser of HDIO_GETGEO to hdio.c.
* defs.h (hdio_ioctl): New prototype.
* ioctl.c (ioctl_decode): Call hdio_ioctl for ioctl type 0x03.
/external/strace/ioctl.c
25f375851087f7340305f7e64452edd6c28be21e 24-May-2016 Dmitry V. Levin <ldv@altlinux.org> ioctl.c: fix build

* ioctl.c (ioctl_decode): Move definition of "ret" variable
to [ALPHA || POWERPC] case.
[ALPHA || POWERPC]: Fix syntax error.
/external/strace/ioctl.c
398fe0493ee0da44fecd98d0c72fab3627060953 19-May-2016 Jeff Mahoney <jeffm@suse.com> ioctl: add decoding for FS_IOC_FIEMAP

* file_ioctl.c: Include <linux/fiemap.h>, "xlat/fiemap_flags.h",
and "xlat/fiemap_extent_flags.h".
(file_ioctl): Handle FS_IOC_FIEMAP.
* ioctl.c (ioctl_decode): Use file_ioctl for decoding 'f' code ioctls.
/external/strace/ioctl.c
8cc6962216d302525be2ba4575932061bb4abd15 19-May-2016 Jeff Mahoney <jeffm@suse.com> ioctl: add decoding support for btrfs ioctls

* btrfs.c: New file.
* file_ioctl.c: Likewise.
* Makefile.am (strace_SOURCES): Add them.
* configure.ac (AC_CHECK_HEADERS): Add linux/btrfs.h.
(AC_CHECK_MEMBERS): Add struct btrfs_ioctl_feature_flags.compat_flags,
struct btrfs_ioctl_fs_info_args.nodesize,
struct btrfs_ioctl_defrag_range_args.start,
and struct btrfs_ioctl_search_args_v2.buf_size.
(AC_CHECK_DECLS): Add BTRFS_COMPRESS_* enums.
* defs.h (btrfs_ioctl, file_ioctl): New prototypes.
* ioctl.c (ioctl_decode) [HAVE_LINUX_BTRFS_H]: Use btrfs_ioctl.
* xlat/btrfs_balance_args.in: New file.
* xlat/btrfs_balance_ctl_cmds.in: Likewise.
* xlat/btrfs_balance_flags.in: Likewise.
* xlat/btrfs_balance_state.in: Likewise.
* xlat/btrfs_compress_types.in: Likewise.
* xlat/btrfs_defrag_flags.in: Likewise.
* xlat/btrfs_dev_replace_cmds.in: Likewise.
* xlat/btrfs_dev_replace_results.in: Likewise.
* xlat/btrfs_dev_replace_state.in: Likewise.
* xlat/btrfs_dev_stats_flags.in: Likewise.
* xlat/btrfs_dev_stats_values.in: Likewise.
* xlat/btrfs_features_compat.in: Likewise.
* xlat/btrfs_features_compat_ro.in: Likewise.
* xlat/btrfs_features_incompat.in: Likewise.
* xlat/btrfs_key_types.in: Likewise.
* xlat/btrfs_qgroup_ctl_cmds.in: Likewise.
* xlat/btrfs_qgroup_inherit_flags.in: Likewise.
* xlat/btrfs_qgroup_limit_flags.in: Likewise.
* xlat/btrfs_qgroup_status_flags.in: Likewise.
* xlat/btrfs_scrub_flags.in: Likewise.
* xlat/btrfs_send_flags.in: Likewise.
* xlat/btrfs_snap_flags_v2.in: Likewise.
* xlat/btrfs_space_info_flags.in: Likewise.
* xlat/btrfs_tree_objectids.in: Likewise.
/external/strace/ioctl.c
5d1216a56b3218716cc8192cb08a3a3e817ea57d 10-May-2016 Dr. David Alan Gilbert <dgilbert@redhat.com> Decode UFFDIO_* ioctls

Decode the ioctls associated with the userfaultfd fd.
Note that they tend to read from and also return result in it's data
structure.

* configure.ac (AC_CHECK_HEADERS): Add linux/userfaultfd.h.
* userfaultfd.c [HAVE_LINUX_USERFAULTFD_H]: Add ioctl decoder.
* defs.h (uffdio_ioctl): New prototype.
* ioctl.c (ioctl_decode) [HAVE_LINUX_USERFAULTFD_H]: Wire in
uffdio_ioctl.
* xlat/uffd_*.in: Create flag xlat for all the IOCTLs.
/external/strace/ioctl.c
8b6046a052255fe71fac200f0f7b3b76419dc16d 04-Dec-2015 Gabriel Laskar <gabriel@lse.epita.fr> ioctl: allow to stop decoding number

For some ioctls, like from drm, the identification of the correct ioctl
is done by custom code. Specifying IOCTL_NUMBER_STOP_LOOKUP on
return of ioctl_decode_command_number() disables further calls to
ioctl_lookup().

* defs.h (IOCTL_NUMBER_UNKNOWN, IOCTL_NUMBER_HANDLED,
IOCTL_NUMBER_STOP_LOOKUP): Add macros representing ioctl number state
decoding.
* ioctl.c (SYS_FUNC(ioctl)): Skip ioctl_lookup() when
ioctl_decode_command_number() returns a value with
IOCTL_NUMBER_STOP_LOOKUP flag is set.

Suggested-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
/external/strace/ioctl.c
9c4fc3404cff4c58b7c9707c85da9661f87131c7 23-Sep-2015 Gabriel Laskar <gabriel@lse.epita.fr> ioctl: fix ioctl command number decoding in case of conflicts

When a command number was decoded through ioctl_decode_command_number(),
there was no check for conflicts with other potential ioctls numbers.

For example:
ioctl(fd, MCE_GET_RECORD_LEN, &i);
output:
ioctl(3, MIXER_READ(1), 0x7ffddce74a58) = 0
instead of:
ioctl(3, MIXER_READ(1) or MCE_GET_RECORD_LEN, 0x7ffee435ce08) = 0

* ioctl.c (SYS_FUNC(ioctl)): Fix ioctl command number decoding
in case of conflicts.
* tests/ioctl.c (main): Add a case for command number conflicts.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
/external/strace/ioctl.c
204c2bc9cb50daf4d3c8b5067a57c071ef55dfc4 08-Jul-2015 Dmitry V. Levin <ldv@altlinux.org> Implement RVAL_DECODED flag

Implement a method for "on entering" parsers to return
"done with decoding" information to their callers.

If a syscall parser called from trace_syscall_entering returns a value
with RVAL_DECODED bit set, record this value in tcp->sys_func_rval
and use it in trace_syscall_exiting instead of calling the parser on
exiting syscall.

If an ioctl parser returned RVAL_DECODED, this would tell
SYS_FUNC(ioctl) that the decoding is finished but fallback printing of
the ioctl command argument is needed, while e.g. RVAL_DONE+1 would mean
that the decoding is finished and no fallback decoding is needed.

* defs.h (struct tcb): Add sys_func_rval.
(RVAL_DECODED): New macro.
* syscall.c (trace_syscall_entering): Initialize tcp->sys_func_rval
along with setting TCB_INSYSCALL flag.
(trace_syscall_exiting): Use tcp->sys_func_rval instead of calling
tcp->s_ent->sys_func when the former has RVAL_DECODED flag set.
Reset tcp->sys_func_rval along with clearing TCB_INSYSCALL flag.
* ioctl.c (sys_ioctl): Set RVAL_DECODED flag on exiting.
Print ioctl argument iff RVAL_DECODED is set and fallback decoding
is requested.
/external/strace/ioctl.c
4f63c113887a738a06e4bd35c7f867e975793f91 03-Jul-2015 Dmitry V. Levin <ldv@altlinux.org> ioctl: prepare ioctl_decode_command_number for future changes

* ioctl.c (ioctl_decode_command_number): Change 1st arg to struct tcb*.
(sys_ioctl): Update callers.
/external/strace/ioctl.c
802c942a36df694d83e8f707e5c07527a53c04d0 03-Jul-2015 Dmitry V. Levin <ldv@altlinux.org> ioctl: simplify ioctl_decode signature

* ioctl.c (ioctl_decode): Remove 2nd and 3rd parameters.
(sys_ioctl): Update callers.
/external/strace/ioctl.c
2803e75450880e1d0588872f8a327e51fabe79f8 03-Jul-2015 Dmitry V. Levin <ldv@altlinux.org> ioctl: consistently use name "code" for ioctl request code

* ioctl.c (evdev_decode_number, hiddev_decode_number,
ioctl_decode_command_number): Rename "arg" to "code".
/external/strace/ioctl.c
044eef21867521a9d0340015dc673f2f5909e804 02-Jul-2015 Dmitry V. Levin <ldv@altlinux.org> Move ioctl syscall parser to ioctl.c

* io.c (sys_ioctl): Move ...
* ioctl.c: ... here.
(ioctl_lookup, ioctl_next_match, ioctl_print_code, ioctl_decode,
ioctl_decode_command_number): Declare as static.
* defs.h (ioctl_lookup, ioctl_next_match, ioctl_print_code,
ioctl_decode, ioctl_decode_command_number): Remove.
/external/strace/ioctl.c
e10b4f02eb6c40a0024fe1172ab4391f07fc8ffc 02-Jul-2015 Dmitry V. Levin <ldv@altlinux.org> ioctl: remove obsolete registry of ioctl characters

* ioctl.c: Remove registry of ioctl characters.
/external/strace/ioctl.c
3460dc486d333231998de0f19918204aacee9ae3 28-Mar-2015 Felix Janda <felix.janda@posteo.de> Include <linux/ioctl.h> for _IOC_* macros

Fix a compilation failure with musl libc.

* evdev.c: Include <linux/ioctl.h>.
* ioctl.c: Include <linux/ioctl.h> instead of <asm/ioctl.h>.
* ioctlsort.c: Likewise.

Reported-by: Dima Krasner <dima@dimakrasner.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
/external/strace/ioctl.c
4f750b9ad1bb870337395355047ac2f89f340feb 20-Feb-2015 Etienne Gemsa <etienne.gemsa@lse.epita.fr> Add decoding for evdev ioctls

This patch introduces decoding for evdev ioctls. For EVIOCSFF the five
first members are decoded, the union is not. The code was compiled and
tested on x86_64 with Linux 3.13.

* evdev.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* defs.h (evdev_ioctl): New prototype.
* ioctl.c (ioctl_decode): Call evdev_ioctl for 'E' ioctl commands.
* xlat/evdev_autorepeat.in: New file.
* xlat/evdev_ff_status.in: New file.
* xlat/evdev_ff_types.in: New file.
* xlat/evdev_keycode.in: New file.
* xlat/evdev_leds.in: New file.
* xlat/evdev_misc.in: New file.
* xlat/evdev_mtslots.in: New file.
* xlat/evdev_prop.in: New file.
* xlat/evdev_relative_axes.in: New file.
* xlat/evdev_snd.in: New file.
* xlat/evdev_switch.in: New file.
* xlat/evdev_sync.in: New file.

Signed-off-by: Etienne Gemsa <etienne.gemsa@lse.epita.fr>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
/external/strace/ioctl.c
df7aa2b19e6f69c19fbe09180bf1ec4fb52e2615 19-Jan-2015 Dmitry V. Levin <ldv@altlinux.org> ioctl: take all 32 bits of ioctl commands into account

Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl
commands were used for decoding, which was the source for numerous
annoying collisions like this:

ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device)

The solution is to use all 32 bits for decoding, not just "number" and
"type", but also "size" and "direction".

As some architectures override defaults that come from asm-generic/ and
provide alternative definitions for some ioctl commands, we support
per-architecture ioctl definitions and merge them with common
definitions at build time. During the merge, we used to keep both
generic and architecture-specific definitions, now architecture-specific
definitions have precedence over generic ones -- ioctlsort omits
definitions from asm-generic/ for those ioctl names that have different
definitions in asm/.

Additional bits of "direction" are architecture specific -- the number
of bits and their values differ between architectures. To reduce
architecture differences in the source code, we keep "direction" in
symbolic form and compile it in ioctlsort.

Additional bits of "size" are also architecture specific -- not only the
number of bits differ between architectures, but sizes of many types
depend on sizeof(long). To reduce architecture differences in the
source code, we keep 32-bit and 64-bit versions of common ioctl
definitions, and use the appropriate version for each architecture and
personality.

To implement this, the tools for generating ioctl definitions from
kernel headers have been rewritten, and the source format of ioctl
definitions has been extended. The final ioctlent*.h files that are
included by syscall.c are now generated from source ioctls_inc*.h and
ioctls_arch*.h files at build time with ioctlsort.

* ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code.
* ioctlsort.c: Rewritten.
* linux/32/ioctls_inc.h: New file.
* linux/64/ioctls_inc.h: New file.
* linux/aarch64/ioctls_arch0.h: New file.
* linux/aarch64/ioctls_arch1.h: New file.
* linux/aarch64/ioctls_inc0.h: New file.
* linux/aarch64/ioctls_inc1.h: New file.
* linux/alpha/ioctls_arch0.h: New file.
* linux/alpha/ioctls_inc0.h: New file.
* linux/arc/ioctls_arch0.h: New file.
* linux/arc/ioctls_inc0.h: New file.
* linux/arm/ioctls_arch0.h: New file.
* linux/arm/ioctls_inc0.h: New file.
* linux/avr32/ioctls_arch0.h: New file.
* linux/avr32/ioctls_inc0.h: New file.
* linux/bfin/ioctls_arch0.h: New file.
* linux/bfin/ioctls_inc0.h: New file.
* linux/hppa/ioctls_arch0.h: New file.
* linux/hppa/ioctls_inc0.h: New file.
* linux/i386/ioctls_arch0.h: New file.
* linux/i386/ioctls_inc0.h: New file.
* linux/ia64/ioctls_arch0.h: New file.
* linux/ia64/ioctls_inc0.h: New file.
* linux/m68k/ioctls_arch0.h: New file.
* linux/m68k/ioctls_inc0.h: New file.
* linux/metag/ioctls_arch0.h: New file.
* linux/metag/ioctls_inc0.h: New file.
* linux/microblaze/ioctls_arch0.h: New file.
* linux/microblaze/ioctls_inc0.h: New file.
* linux/mips/ioctls_arch0.h: New file.
* linux/mips/ioctls_inc0.h: New file.
* linux/or1k/ioctls_arch0.h: New file.
* linux/or1k/ioctls_inc0.h: New file.
* linux/powerpc/ioctls_arch0.h: New file.
* linux/powerpc/ioctls_inc0.h: New file.
* linux/powerpc64/ioctls_arch0.h: New file.
* linux/powerpc64/ioctls_arch1.h: New file.
* linux/powerpc64/ioctls_inc0.h: New file.
* linux/powerpc64/ioctls_inc1.h: New file.
* linux/s390/ioctls_arch0.h: New file.
* linux/s390/ioctls_inc0.h: New file.
* linux/s390x/ioctls_arch0.h: New file.
* linux/s390x/ioctls_inc0.h: New file.
* linux/sh/ioctls_arch0.h: New file.
* linux/sh/ioctls_inc0.h: New file.
* linux/sh64/ioctls_arch0.h: New file.
* linux/sh64/ioctls_inc0.h: New file.
* linux/sparc/ioctls_arch0.h: New file.
* linux/sparc/ioctls_inc0.h: New file.
* linux/sparc64/ioctls_arch0.h: New file.
* linux/sparc64/ioctls_arch2.h: New file.
* linux/sparc64/ioctls_inc0.h: New file.
* linux/sparc64/ioctls_inc2.h: New file.
* linux/tile/ioctls_arch0.h: New file.
* linux/tile/ioctls_arch1.h: New file.
* linux/tile/ioctls_inc0.h: New file.
* linux/tile/ioctls_inc1.h: New file.
* linux/x32/ioctls_arch0.h: New file.
* linux/x32/ioctls_arch1.h: New file.
* linux/x32/ioctls_inc0.h: New file.
* linux/x32/ioctls_inc1.h: New file.
* linux/x86_64/ioctls_arch0.h: New file.
* linux/x86_64/ioctls_arch1.h: New file.
* linux/x86_64/ioctls_inc0.h: New file.
* linux/x86_64/ioctls_inc1.h: New file.
* linux/xtensa/ioctls_arch0.h: New file.
* linux/xtensa/ioctls_inc0.h: New file.
* linux/aarch64/ioctlent.h.in: Remove.
* linux/aarch64/ioctlent1.h: Remove.
* linux/alpha/ioctlent.h.in: Remove.
* linux/arc/ioctlent.h.in: Remove.
* linux/arm/ioctlent.h.in: Remove.
* linux/avr32/ioctlent.h.in: Remove.
* linux/bfin/ioctlent.h.in: Remove.
* linux/hppa/ioctlent.h.in: Remove.
* linux/i386/ioctlent.h.in: Remove.
* linux/ia64/ioctlent.h.in: Remove.
* linux/ioctlent.h.in: Remove.
* linux/ioctlent.sh: Remove.
* linux/m68k/ioctlent.h.in: Remove.
* linux/metag/ioctlent.h.in: Remove.
* linux/microblaze/ioctlent.h.in: Remove.
* linux/mips/ioctlent.h.in: Remove.
* linux/mips/ioctlent.sh: Remove.
* linux/or1k/ioctlent.h.in: Remove.
* linux/powerpc/ioctlent.h.in: Remove.
* linux/powerpc64/ioctlent.h: Remove.
* linux/powerpc64/ioctlent1.h: Remove.
* linux/s390/ioctlent.h.in: Remove.
* linux/s390x/ioctlent.h.in: Remove.
* linux/sh/ioctlent.h.in: Remove.
* linux/sh64/ioctlent.h.in: Remove.
* linux/sparc/ioctlent.h.in: Remove.
* linux/sparc64/ioctlent.h.in: Remove.
* linux/sparc64/ioctlent2.h: Remove.
* linux/tile/ioctlent.h.in: Remove.
* linux/tile/ioctlent1.h: Remove.
* linux/x32/ioctlent.h.in: Remove.
* linux/x32/ioctlent1.h: Remove.
* linux/x86_64/ioctlent.h.in: Remove.
* linux/x86_64/ioctlent1.h: Remove.
* linux/xtensa/ioctlent.h.in: Remove.
* linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h.
* syscall.c (struct_ioctlent ioctlent0): Likewise.
* Makefile.am: Remove all ioctlent-related definitions.
Define the list of ioctlent*.h files that have to be generated by
presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files.
Add rules for ioctlent*.h files generation.
(EXTRA_DIST): Update.
* maint/ioctls_gen.sh: New file.
* maint/ioctls_hex.sh: New file.
* maint/ioctls_sym.sh: New file.
* maint/print_ioctlent.c: New file.
* HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration.
* .gitignore: Add ioctlent[012].h and ioctls_all[012].h.
* configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h
and linux/mmtimer.h for tests.
* tests/ioctl.c: New file.
* tests/ioctl.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add ioctl.
(TESTS): Add ioctl.test.
* tests/.gitignore: Add ioctl.
/external/strace/ioctl.c
6f9a01c72121bc0b0fc760d9fea6879fb85f6f02 21-Jan-2015 Gabriel Laskar <gabriel@lse.epita.fr> ioctl: add decoding for parametrized command names

Some ioctl commands from evdev, hiddev, mixer, uinput, spi, and joystick
are parametrized by a size or a number that are variable. This change
implements printing of these parametrized ioctl command names.

* configure.ac (AC_CHECK_HEADERS): Add linux/input.h.
* defs.h (ioctl_decode_number): New prototype.
* io.c (sys_ioctl): Use ioctl_decode_number.
* ioctl.c (ioctl_decode_number): New function.
* xlat/evdev_abs.in: New file.
* xlat/evdev_ev.in: New file.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
/external/strace/ioctl.c
924996a41e54a3ac6bb90a43a8cebbbf6c0e1319 20-Jan-2015 Dmitry V. Levin <ldv@altlinux.org> ioctl: print unrecognized ioctl codes in _IOC(dir,type,nr,size) format

* defs.h (ioctl_print_code): New prototype.
* ioctl.c: Include xlat/ioctl_dirs.h.
(ioctl_print_code): New function.
* io.c (sys_ioctl): Use it.
* xlat/ioctl_dirs.in: New file.
/external/strace/ioctl.c
c7afb4881f14e44968f3a78ae5988f04ecc66b68 19-Jan-2015 Dmitry V. Levin <ldv@altlinux.org> 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.
/external/strace/ioctl.c
5b88608b296c44c67ffa25900b8c2e496c2b41a4 21-Nov-2014 Mike Frysinger <vapier@gentoo.org> Decode FIFREEZE/FITHAW/FITRIM ioctls

The freeze/thaw ones are simple, but the trim is an interesting struct.

* block.c (block_ioctl): Handle FIFREEZE/FITHAW/FITRIM.
* ioctl.c (ioctl_decode): Pass 'X' ioctls to block_ioctl.
/external/strace/ioctl.c
0cc961440b527ff8c16954fc411a1529072edb92 03-Nov-2014 Philippe De Muyter <phdm@macqel.be> Implement Video4Linux video-input ioctls decoder

Introduce v4l2.c, a decoder for the arguments of the video-input subset
of the v4l2 ioctl's. This is a combination of
- previous work by Peter Zotov <whitequark@whitequark.org>, found at
https://gist.githubusercontent.com/whitequark/1263207/raw/strace-4.6-v4l2-ioctls.patch
- previous work by William Manley <will@williammanley.net>, found at
http://marc.info/?l=strace&m=139395588520675
- forward port, additions and fixes by Philippe De Muyter <phdm@macqel.be>

As v4l2 is a moving target, I have made v4l2.c compilable with ancient
linux kernels by testing the availability of some macros. It has been
succesfully compiled on linux 3.10, 3.1, 2.6.31 and 2.6.22, and
succesfully used on linux 3.10 with a camera device.

* configure.ac: Check for availabilty of V4L2_* enum constants.
* Makefile.am (strace_SOURCES): Add v4l2.c.
* defs.h (v4l2_ioctl): New prototype.
* ioctl.c (ioctl_decode): Use v4l2_ioctl.
* v4l2.c: New file.
* xlat/v4l2_*.in: New files.

Signed-off-by: Philippe De Muyter <phdm@macqel.be>
Cc: Peter Zotov <whitequark@whitequark.org>
Cc: William Manley <will@williammanley.net>
/external/strace/ioctl.c
3ed5d021837768405d9f9c9e7d2b05dc6a110d94 10-Sep-2014 Dmitry V. Levin <ldv@altlinux.org> Fix compilation warnings reported by gcc -Wsign-compare

* configure.ac (gl_WARN_ADD): Add -Wsign-compare.
* defs.h (struct tcb): Change 'currpers' type to unsigned.
(struct xlat): Change 'val' type to unsigned
(signame): Add 'const' qualifier to its argument.
(xlookup, printxval): Add 'const' qualifier to the 2nd argument and
change its type to unsigned.
(printpathn): Change the 3rd argument type to unsigned.
(ioctl_lookup): Change 1st argument type to unsigned.
* count.c (call_summary_pers, call_summary): Change 'i' type to unsigned.
* file.c (print_xattr_list): Fix comparisons between signed and unsigned
long values.
* ioctl.c (compare): Fix cast.
(ioctl_lookup): Change 1st argument type to to unsigned.
(ioctl_next_match): Change 'code' type to unsigned.
* mem.c (sys_move_pages): Change 'i' type to unsigned.
* mtd.c (mtd_ioctl): Change 'i' and 'j' types to unsigned.
Print 'i' using %u format string.
* process.c (sys_prctl): Change 'i' type to unsigned.
(printargv): Change 'n' type to unsigned.
(sys_ptrace): Change 'addr' type to unsigned.
* scsi.c (print_sg_io_buffer): Add 'const' qualifier to 'len' argument
and change its type to unsigned. Change 'i' and 'allocated' types
to unsigned.
* signal.c (signame): Add 'const' qualifier to its argument.
Fix comparisons between signed and unsigned values.
(sprintsigmask_n, printsiginfo): Fix comparisons between signed and
unsigned values.
* sock.c (sock_ioctl): Change 'i' and 'nifra' types to unsigned.
* strace.c (expand_tcbtab, alloctcb): Change 'i' type to unsigned.
(detach): Change 'sig' type to unsigned.
(startup_attach): Change 'tcbi' type to unsigned.
(startup_child): Change 'm', 'n', and 'len' types to unsigned.
(init): Use new variable to iterate 'tcbtab'.
(pid2tcb): Change 'i' type to unsigned.
(cleanup): Change 'i' and 'sig' types to unsigned.
* syscall.c (update_personality): Change 'personality' argument type
to unsigned.
(struct qual_options): Change 'bitflag' type to unsigned.
(reallocate_qual): Add 'const' qualifier to its argument and change its
type to unsigned.
(qualify_one): Change 'n' and 'bitflag' arguments types to unsigned.
Add 'const' qualifier to 'n', 'not', and 'pers' arguments.
Change 'p' type to signed int.
(qual_syscall): Change 'bitflag' argument type to unsigned.
Add 'const' qualifier to 'bitflag' and 'not' arguments.
Change 'p' type to signed int.
(qual_signal): Change 'bitflag' argument type to unsigned.
Add 'const' qualifier to 'bitflag' and 'not' arguments.
Change 'i' type to unsigned.
(qual_desc): Change 'bitflag' argument type to unsigned.
Add 'const' qualifier to 'bitflag' and 'not' arguments.
(qualify): Change 'i' type to unsigned.
(get_scno): Change 'currpers' type to unsigned.
Fix a comparison between signed and unsigned values.
* system.c (sys_sysctl): Change 'cnt' and 'max_cnt' types to unsigned.
Fix comparisons between signed and unsigned values.
* util.c (xlookup, printxval): Add 'const' qualifier to 'val' argument
and change its type to unsigned.
(printuid): Fix a comparison between signed and unsigned values.
(printpathn): Change 'n' argument type to unsigned.
(printstr): Change 'size' type to unsigned.
Fix a comparison between signed and unsigned values.
(setbpt): Change 'i' type to unsigned.
* net.c (printsock): Silence a compilation warning.
* reboot.c (sys_reboot): Likewise.
/external/strace/ioctl.c
fdb896e577d4154b4dbd4350c9828e7df3b7da84 26-Feb-2014 Dmitry V. Levin <ldv@altlinux.org> Do not compile scsi ioctl decoding if <scsi/sg.h> is not available

Add a generic test for <scsi/sg.h> availability to fix build with
Bionic libc that does not provide <scsi/sg.h>.

* configure.ac (AC_CHECK_HEADERS): Add scsi/sg.h.
* ioctl.c (ioctl_decode): Do not call scsi_ioctl if !HAVE_SCSI_SG_H.
* scsi.c: Do not compile scsi ioctl decoding if !HAVE_SCSI_SG_H.

Reported-by: Elliott Hughes <enh@google.com>
/external/strace/ioctl.c
b88a6f877eb08e6d45130374fc1a1867371db703 31-Jan-2014 Stefan Sørensen <stefan.sorensen@spectralink.com> Decode ptp ioctls

* defs.h (ptp_ioctl): New prototype.
* ioctl.c (ioctl_decode): Call ptp_ioctl when code is '='.
* Makefile.am (strace_SOURCES): Add ptp.c.
(EXTRA_DIST): Add linux/ptp_clock.h.
* ptp.c: New file.
* linux/ptp_clock.h: New file.

Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
/external/strace/ioctl.c
d648f29cc3aeabf0a0430f8ab12ce35fa6c4e48e 02-May-2013 Mike Frysinger <vapier@gentoo.org> Decode mtd/ubi ioctls

Been playing with UBI of late and it'd help if I could see what it was
doing. Not entirely sure about the decoding of UBI_IOCVOLUP -- it takes
a pointer to a 64bit value, not a strict.

* util.c (MAX, MIN): Move to ...
* defs.h (MAX, MIN): ... here.
(CLAMP): Define.
(ubi_ioctl): New prototype.
* ioctl.c (ioctl_decode): Call ubi_ioctl when code is 'o' or 'O'.
* mtd.c: Include ubi user API header.
(ubi_volume_types): New enum decode.
(ubi_volume_props): Likewise.
(ubi_ioctl): Define.
* linux/ubi-user.h: Import from linux 3.8.
/external/strace/ioctl.c
a9fe13c9437707fa132fde4e51a20d88381e7430 22-Feb-2013 Denys Vlasenko <vda.linux@googlemail.com> Create and use struct_sysent and struct_ioctlent typedefs.

This is a preparatory mass replace patch with no code changes.

The future change will need to typedef sysent to sysent0,
which results in compile failures when "struct sysent" string
gets mangled into "struct sysent0".

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/ioctl.c
ebee04cfb009bdc46599774b4647f6615b6ce3a2 18-Apr-2012 Mike Frysinger <vapier@gentoo.org> Decode /dev/loop ioctls

Needed to debug some losetup failures, and it's easier when you can see
what the kernel is getting vs what you think you're sending, so add some
decoders for those ioctls.

* loop.c: New file.
* Makefile.am (strace_SOURCES): Add loop.c.
* defs.h (loop_ioctl): New prototype.
(string_quote): Likewise.
* ioctl.c (ioctl_decode): Call loop_ioctl when code is 'L'.
* util.c (string_quote): Remove static keyword.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
/external/strace/ioctl.c
0cbed357ab749fa0cf58e8d72230c2ed92334932 05-Apr-2012 Mike Frysinger <vapier@gentoo.org> Decode mtd ioctls

I got tired of figuring out mtd structures (which show up a lot
in the embedded space), so add decoders for those ioctls.

* defs.h (mtd_ioctl): New prototype.
(print_loff_t): Likewise.
* io.c (print_loff_t): Delete static keyword
* ioctl.c (ioctl_decode): Call mtd_ioctl when code is 'M'.
* Makefile.am (strace_SOURCES): Add mtd.c.
(EXTRA_DIST): Add linux/mtd-abi.h.
* mtd.c: New file.
* linux/mtd-abi.h: New file.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
/external/strace/ioctl.c
806fbce4e6133d87f4970e9ba1460c618b5fc23e 20-Mar-2012 Dmitry V. Levin <ldv@altlinux.org> Do not include limits.h unnecessarily

* ioctl.c: Remove limits.h inclusion left after the reverted change.
/external/strace/ioctl.c
feb40c4543d22468bb6dc7e3c29746ee2d4e06cc 20-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Partially revert last change

Thank you Dmitry for spotting it.

* ioctl.c (compare): Partially revert last change - the new
comparison logic was buggy.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/ioctl.c
1c2e912cc3e1be4081334b9ce0114c10a72166c6 20-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Simplify search in ioctl table

text data bss dec hex filename
236973 704 18944 256621 3ea6d strace.before
236929 704 18944 256577 3ea41 strace

* ioctl.c (compare): Simplify generation of compare result.
(ioctl_lookup): Pass key directly, not as part of dummy struct.
(ioctl_next_match): More readable code. No logic changes.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/ioctl.c
a6d91ded3f2d5401e09a9c2fa442aabfbfe593a8 16-Mar-2012 Denys Vlasenko <vda.linux@googlemail.com> Tidy up includes and copyright notices, fix indentation

The files not mentioned in changelog below had only
copyright notices fixes and indentation fixes.

* defs.h: Include <stdint.h> and <inttypes.h>.
* file.c: Do not include <inttypes.h>.
Move struct kernel_dirent declaration below top include block.
* block.c: Do not include <stdint.h> and <inttypes.h>.
* quota.c: Likewise.
* desc.c: Likewise.
* signal.c: Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/ioctl.c
aa925db23634fe6a2c1d4b47accb3649daf1b781 25-Feb-2012 Denys Vlasenko <vda.linux@googlemail.com> Remove a few more code parts which are unused on Linux

This change is abapted from Dmitry's changes to remove support for
non-Linux architectures.

* Makefile.am: Remove if LINUX/endif pairs.
* defs.h: Remove stream_ioctl() declaration.
* ioctl.c (ioctl_decode): Remove 'ifdef HAVE_SYS_STREAM_H' block.
* resource.c: Use 'defined(FOO)' instead of 'defined FOO' form.
* util.c: Likewise.
* signal.c: Remove conditional includes which are never used on Linux.
* stream.c: Likewise.
* file.c: Remove excessive empty lines.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/ioctl.c
ed720fda5d515f1359fcd3242223e553d1216789 25-Feb-2012 Denys Vlasenko <vda.linux@googlemail.com> Automated removal of non-Linux code

This change is generated by running every source through the following command:

unifdef -DLINUX -Dlinux -USUNOS4 -USVR4 -UUNIXWARE -UFREEBSD
-USUNOS4_KERNEL_ARCH_KLUDGE -UHAVE_MP_PROCFS
-UHAVE_POLLABLE_PROCFS -UHAVE_PR_SYSCALL -UUSE_PROCFS file.c

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/external/strace/ioctl.c
6b6ed5d669c04fb949dfc88ed0571e3db0d11571 20-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Convert ioctl_next_match() to new-style C function definition

* ioctl.c (ioctl_next_match): Convert to new-style C function definition.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/ioctl.c
39fca628019cbfa01835482ac8559e21fde7f03c 20-Aug-2011 Denys Vlasenko <dvlasenk@redhat.com> Small optimization in signal and ioctl tables

Trivial shuffling of data tables puts them all in one file,
allowing gcc to see their sizes and eliminate variables
which store these sizes.

Surprisingly, in C mode gcc does not optimize out static const int
variables. Help it by using enums instead.

* defs.h: Stop exporting ioctlent{0,1,2}, nioctlents{0,1,2},
signalent{0,1,2}, nsignals{0,1,2}.
* ioctl.c: Remove definitions of ioctlent{,0,1,2} and nioctlents{,0,1,2}.
* signal.c: Remove definitions of signalent{,0,1,2} and nsignals{,0,1,2}.
* syscall.c: Move above definitions to this file. Make them static const
or enums if suitable.
/external/strace/ioctl.c
fcda7a5f4fcfbedb5493bbfc1b37e53c6b3a575c 13-Jun-2011 Dmitry V. Levin <ldv@altlinux.org> Introduce ARRAY_SIZE() macro

* defs.h (ARRAY_SIZE): New macro.
* ioctl.c: Use it.
* pathtrace.c (pathmatch, storepath): Likewise.
* process.c (printpriv): Likewise.
* signal.c: Likewise.
* syscall.c: Likewise.
/external/strace/ioctl.c
1201426dd43f5b4e12dfe520e2a9c5027d33dc11 30-May-2011 Denys Vlasenko <dvlasenk@redhat.com> "Modernize" all old-style function parameter declarations

* bjm.c: Convert all remaining old-style C function definitions
to a "modern" form. This does not change any actual code.
* io.c: Likewise
* ioctl.c: Likewise
* net.c: Likewise
* proc.c: Likewise
* process.c: Likewise
* signal.c: Likewise
* sock.c: Likewise
* strace.c: Likewise
* stream.c: Likewise
* syscall.c: Likewise
* system.c: Likewise
* time.c: Likewise
* util.c: Likewise

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
/external/strace/ioctl.c
4ef6db489a8a51ae03ffb78b58c679162a39f3c3 15-Jan-2011 Dmitry V. Levin <ldv@altlinux.org> Add block ioctl support

* block.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* defs.h [LINUX] (block_ioctl): New function.
* ioctl.c (ioctl_decode) [LINUX]: Use it to decode HDIO_* and BLK*
ioctls.
Patch by Jeff Mahoney <jeffm@suse.com>
/external/strace/ioctl.c
b011af5ef077fcfc2ad967579dcb1e5ed9b3193e 30-Jun-2007 Dmitry V. Levin <ldv@altlinux.org> 2007-03-29 Vladimir Nadvornik <nadvornik@suse.cz>
Dmitry V. Levin <ldv@altlinux.org>

Trace linux SG_IO ioctl arguments and results.
* scsi.c: New file.
* Makefile.am (strace_SOURCES): Add scsi.c
* defs.h (scsi_ioctl): New function.
* ioctl.c (ioctl_decode): Use scsi_ioctl().
/external/strace/ioctl.c
ddce11b805b1db9452a4dbd3972f6f4aeeab0499 02-Feb-2005 Roland McGrath <roland@redhat.com> 2005-02-02 Roland McGrath <roland@redhat.com>

* linux/sparc/syscall.h: Declare sys_epoll_create, sys_epoll_ctl,
sys_epoll_wait.
* linux/sparc64/syscall.h: Just #include "../sparc/syscall.h" here.
* ioctl.c (nioctlents2): Add const to type.
Fixes Debian bug #278449.
/external/strace/ioctl.c
d83c50b8e44db2a2e19d048ab7d1e1caf1fa1996 07-Oct-2004 Roland McGrath <roland@redhat.com> 2004-09-13 Ulrich Drepper <drepper@redhat.com>, Dmitry V. Levin <ldv@altlinux.org>

* time.c [LINUX] (print_rtc): New function, for printing rtc_time
structure.
[LINUX] (rtc_ioctl): New function, for parsing RTC_* ioctls.
* ioctl.c [LINUX] (ioctl_decode): Call rtc_ioctl.
* defs.h [LINUX]: Declare rtc_ioctl.
Fixes RH#58606.
/external/strace/ioctl.c
ee36ce19e03e08f4b692570090ee58b72d2f0f50 04-Sep-2004 Roland McGrath <roland@redhat.com> 2004-09-03 Roland McGrath <roland@redhat.com>

* syscall.c (sysent0, sysent1, sysent2, sysent): Add const to defn.
(nsyscalls0, nsyscalls1, nsyscalls2): Likewise.
(errnoent0, errnoent1, errnoent2, errnoent): Likewise.
(nerrnos0, nerrnos1, nerrnos2): Likewise.
* signal.c (signalent0, signalent1, signalent2): Likewise.
(nsignals0, nsignals1, nsignals2): Likewise.
(signame): LIkewise.
* ioctl.c (ioctlent0, ioctlent1, ioctlent2): Likewise.
(nioctlents0, nioctlents1, nioctlents2): Likewise.
(ioctl_lookup, ioctl_next_match): Likewise.
* defs.h: Update decls.
* io.c (sys_ioctl): Update users.
/external/strace/ioctl.c
6d1a65c759c6c650e47ce5045a26380a4acbdffa 12-Jul-2004 Roland McGrath <roland@redhat.com> 2004-07-07 David S. Miller <davem@nuts.davemloft.net>

* linux/sparc/syscallent.h: Sync with reality.
* linux/sparc/syscall.h (sys_sendfile64, sys_futex, sys_gettid,
sys_sched_setaffinity, sys_sched_getaffinity, sys_setxattr,
sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr,
sys_fgetxattr, sys_listxattr, sys_llistxattr, sys_flistxattr,
sys_removexattr, sys_lremovexattr, sys_fremovexattr,
sys_remap_file_pages, sys_readahead, sys_tgkill, sys_statfs64,
sys_fstatfs64, sys_clock_settime, sys_clock_gettime,
sys_clock_getres, sys_clock_nanosleep, sys_timer_create,
sys_timer_settime, sys_timer_gettime): New declarations.
* linux/sparc64/dummy2.h, linux/sparc64/syscallent2.h,
linux/sparc64/syscall.h, linux/sparc64/errnoent.h,
linux/sparc64/errnoent1.h, linux/sparc64/errnoent2.h,
linux/sparc64/ioctlent.h, linux/sparc64/ioctlent1.h,
linux/sparc64/ioctlent2.h, linux/sparc64/signalent.h,
linux/sparc64/signalent.h, linux/sparc64/signalent.h,
linux/sparc64/signalent1.h, linux/sparc64/signalent2.h,
linux/sparc64/syscall1.h, linux/sparc64/syscallent.h,
linux/sparc64/syscallent1.h: New files.
* defs.h (LINUXSPARC): Define also when SPARC64.
(LINUX && SPARC64): Set SUPPORTED_PERSONALITIES to 3.
Ignore SIGTRAP after execve by defining TCB_WAITEXECVE.
Define possibly missing __NR_exit_group. Declare getrval2.
* configure.ac (sparc64): New architecture case.
* config.h.in (SPARC64): New define.
* file.c (stat_sparc64): New structure.
(printstat_sparc64): New output routine for that.
(printstat): Call it, if personality is 2.
(printstat64): Likewise.
* util.c: Conditionalize ptrace defines on LINUXSPARC
not LINUX && SPARC.
(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
to PTRACE_FOOREGS64 so that more sparc code can be shared
between 64-bit and 32-bit.
(_hack_syscall5): Correct trap number when SPARC64.
(PTRACE_WRITE{TEXT,DATA}): Add SPARC64 to ifdef guard.
(getpc): Handle SPARC64 && LINUX.
(printcall): Likewise.
(arg fetching/setting): Use same code for SPARC64 LINUX
as for SPARC.
(setbpt): Handle SPARC64 && LINUX.
(clearbpt): Likewise.
* signal.c: Conditionalize ptrace defines on SPARC and
SPARC64.
(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
to PTRACE_FOOREGS64 so that more sparc code can be shared
between 64-bit and 32-bit.
(m_siginfo): Use same definition on SPARC64 as SPARC.
(sys_sigreturn): Handle LINUX && SPARC64.
* syscall.c: Conditionalize ptrace defines on SPARC and
SPARC64.
(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
to PTRACE_FOOREGS64 so that more sparc code can be shared
between 64-bit and 32-bit.
(getscno): Use same static state on SPARC64 as SPARC,
and add SPARC64 handling.
(get_error): Handle LINUX && SPARC64.
(force_result): Likewise.
(syscall_enter): Likewise.
(trace_syscall): Handle sys_socketcall and sys_ipc on SPARC64
just like SPARC.
(getrval2): Handle LINUX && SPARC64.
* process.c: Conditionalize ptrace defines on SPARC and
SPARC64.
(SPARC64 && LINUX): Define r_pc to r_tpc, and PTRACE_FOOREGS
to PTRACE_FOOREGS64 so that more sparc code can be shared
between 64-bit and 32-bit.
(change_syscall): Handle LINUX && SPARC64.
(struct_user_offsets): Ifdef out those which do not exist
on SPARC64.
* net.c (sys_pipe): Handle LINUX && SPARC64.
* ioctl.c: Fix initializer typo for nioctlents2, was
nioctlents1 by accident.
/external/strace/ioctl.c
2843a4e1d2fca851be6e47e7ff2413b45903ac9a 14-Nov-2003 Roland McGrath <roland@redhat.com> 2003-09-06 Dmitry V. Levin <ldv@altlinux.org>

* defs.h (ioctl_lookup): Prototype change.
* ioctl.c (ioctl_next_match): New function.
* defs.h: Declare it.
* io.c (sys_ioctl): Use it, to display all possible ioctl names
when there's more than one match.
* ioctl.c (ioctl_lookup): Likewise.
* stream.c (internal_stream_ioctl): Likewise.
Patch from Solar Designer <solar@openwall.com>.
/external/strace/ioctl.c
bb3af52962a322da7cb13966ae66ab9fa5b314d4 14-Jan-2003 Roland McGrath <roland@redhat.com> 2003-01-13 Roland McGrath <roland@redhat.com>

* ioctl.c (ioctl_decode) [POWERPC]: Decode term ioctls like Alpha.
From Anton Blanchard <anton@samba.org>.
/external/strace/ioctl.c
c6c1ea5440ca78e9fab99d7f3e18a54ba4d7b7f0 03-Aug-2001 Wichert Akkerman <wichert@deephackmode.org> Copyright update
/external/strace/ioctl.c
1c595a437d9a610b45b46da20be77aecd06e9d76 03-Aug-2001 Wichert Akkerman <wichert@deephackmode.org> remember to shift ioctl masks as well
/external/strace/ioctl.c
a966785753cbabaf44b39c75d387adf423e44caa 17-Mar-2001 Wichert Akkerman <wichert@deephackmode.org> Implement new way to get the ioctl list for Linux: instead of
trying to #include every possible kernel header grab all the relevant
#defines from them and use those directly.
/external/strace/ioctl.c
bf79f2e16b090ffe59cd1e1820935680a2da7b78 01-Sep-2000 Wichert Akkerman <wichert@deephackmode.org> Add FreeBSD support
/external/strace/ioctl.c
4dc8a2aec63e4fb5ee2688544c4de323ed5de3ef 23-Dec-1999 Wichert Akkerman <wichert@deephackmode.org> Bunch of stuff
/external/strace/ioctl.c
ea78f0f77185f7d6d0b2055805139d96e1be816c 29-Nov-1999 Wichert Akkerman <wichert@deephackmode.org> Add UnixWare support to configure
/external/strace/ioctl.c
9ce1a63eb20b069607c06f9645ac5a17b418a5f3 30-Aug-1999 Wichert Akkerman <wichert@deephackmode.org> Catching up on my mail-backlog, see ChangeLog for details
/external/strace/ioctl.c
76baf7c9f6dd61a15524ad43c1b690c252cf5b7c 19-Feb-1999 Wichert Akkerman <wichert@deephackmode.org> Initial revision
/external/strace/ioctl.c