summaryrefslogtreecommitdiff
path: root/ioctl.c
Commit message (Collapse)AuthorAge
* Do not compile scsi ioctl decoding if <scsi/sg.h> is not availableDmitry V. Levin2014-02-25
| | | | | | | | | | | 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>
* Decode ptp ioctlsStefan Sørensen2014-02-04
| | | | | | | | | | | | * 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>
* Decode mtd/ubi ioctlsMike Frysinger2013-05-02
| | | | | | | | | | | | | | | | | 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.
* Create and use struct_sysent and struct_ioctlent typedefs.Denys Vlasenko2013-02-22
| | | | | | | | | | 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>
* Decode /dev/loop ioctlsMike Frysinger2012-04-18
| | | | | | | | | | | | | | | 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>
* Decode mtd ioctlsMike Frysinger2012-04-06
| | | | | | | | | | | | | | | | 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>
* Do not include limits.h unnecessarilyDmitry V. Levin2012-03-20
| | | | * ioctl.c: Remove limits.h inclusion left after the reverted change.
* Partially revert last changeDenys Vlasenko2012-03-20
| | | | | | | | | 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>
* Simplify search in ioctl tableDenys Vlasenko2012-03-20
| | | | | | | | | | | | 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>
* Tidy up includes and copyright notices, fix indentationDenys Vlasenko2012-03-16
| | | | | | | | | | | | | | | 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>
* Remove a few more code parts which are unused on LinuxDenys Vlasenko2012-02-25
| | | | | | | | | | | | | | | | | 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>
* Automated removal of non-Linux codeDenys Vlasenko2012-02-25
| | | | | | | | | | 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>
* Convert ioctl_next_match() to new-style C function definitionDenys Vlasenko2011-08-23
| | | | | | * ioctl.c (ioctl_next_match): Convert to new-style C function definition. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
* Small optimization in signal and ioctl tablesDenys Vlasenko2011-08-23
| | | | | | | | | | | | | | | | 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.
* Introduce ARRAY_SIZE() macroDmitry V. Levin2011-06-13
| | | | | | | | | * 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.
* "Modernize" all old-style function parameter declarationsDenys Vlasenko2011-05-30
| | | | | | | | | | | | | | | | | | | | * 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>
* Add block ioctl supportDmitry V. Levin2011-01-15
| | | | | | | | | * 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>
* 2007-03-29 Vladimir Nadvornik <nadvornik@suse.cz>Dmitry V. Levin2007-06-30
| | | | | | | | | | 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().
* 2005-02-02 Roland McGrath <roland@redhat.com>Roland McGrath2005-02-02
| | | | | | | | * 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.
* 2004-09-13 Ulrich Drepper <drepper@redhat.com>, Dmitry V. Levin ↵Roland McGrath2004-10-06
| | | | | | | | | | | <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.
* 2004-09-03 Roland McGrath <roland@redhat.com>Roland McGrath2004-09-04
| | | | | | | | | | | | | | | * 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.
* 2004-07-07 David S. Miller <davem@nuts.davemloft.net>Roland McGrath2004-07-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* 2003-09-06 Dmitry V. Levin <ldv@altlinux.org>Roland McGrath2003-11-14
| | | | | | | | | | | * 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>.
* 2003-01-13 Roland McGrath <roland@redhat.com>Roland McGrath2003-01-14
| | | | | * ioctl.c (ioctl_decode) [POWERPC]: Decode term ioctls like Alpha. From Anton Blanchard <anton@samba.org>.
* Copyright updateWichert Akkerman2001-08-03
|
* remember to shift ioctl masks as wellWichert Akkerman2001-08-03
|
* Implement new way to get the ioctl list for Linux: instead ofWichert Akkerman2001-03-17
| | | | | trying to #include every possible kernel header grab all the relevant #defines from them and use those directly.
* Add FreeBSD supportWichert Akkerman2000-09-01
|
* Bunch of stuffWichert Akkerman1999-12-23
|
* Add UnixWare support to configureWichert Akkerman1999-11-29
|
* Catching up on my mail-backlog, see ChangeLog for detailsWichert Akkerman1999-08-29
|
* Initial revisionWichert Akkerman1999-02-19